commit e8a021dd10e374ad53dc3c3bffcf753f79782e1a Author: oleg Date: Thu Dec 7 21:05:00 2023 +0300 Initial commit, added my first prototype diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5be7562 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# Godot 4+ specific ignores +.godot/ + +# Ignore KDE .desktop files +*.directory diff --git a/Prototypes/tiredbun-prototype-1/Player.gd b/Prototypes/tiredbun-prototype-1/Player.gd new file mode 100644 index 0000000..4c1da8a --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/Player.gd @@ -0,0 +1,45 @@ +extends CharacterBody2D + +# Скорость хождения +@export var base_movement_speed = 300.0 + +func _ready(): + pass + +func _physics_process(_delta): + var horizontal_direction = Input.get_axis("ui_left", "ui_right") + var vertical_direction = Input.get_axis("ui_up", "ui_down") + if horizontal_direction: + velocity.x = horizontal_direction * base_movement_speed + if vertical_direction: + velocity.x = velocity.x/2 + # иначе будет складываться скорость по вертикали и горизонтали + else: + velocity.x = move_toward(velocity.x, 0, base_movement_speed) + if vertical_direction: + velocity.y = vertical_direction * base_movement_speed + if horizontal_direction: + velocity.x = velocity.x/2 + # иначе будет складываться скорость по вертикали и горизонтали + else: + velocity.y = move_toward(velocity.y, 0, base_movement_speed) + + # Проверка, куда должен смотреть персонаж + # вертикальная анимация имеет больший приоритет + if horizontal_direction < 0 and !vertical_direction: + $PlayerSprite.animation = "left-go" + if horizontal_direction > 0 and !vertical_direction: + $PlayerSprite.animation = "right-go" + if vertical_direction < 0: + $PlayerSprite.animation = "up-go" + if vertical_direction > 0: + $PlayerSprite.animation = "down-go" + + # Проверка, должна ли играть анимация + if (velocity.x == 0) and (velocity.y == 0): + $PlayerSprite.frame = 0 # поставить анимацию на первый кадр + $PlayerSprite.stop() # остановить анимацию + else: + $PlayerSprite.play() # играть анимацию + + move_and_slide() # Применяет передедвижение diff --git a/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg b/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg new file mode 100644 index 0000000..b06fa3b Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg differ diff --git a/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg.import b/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg.import new file mode 100644 index 0000000..607b005 --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b0bmwarkx2fxb" +path="res://.godot/imported/mpv-shot0001.jpg-4c0b1d2bc221c05906c91de8aef5b655.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/mpv-shot0001.jpg" +dest_files=["res://.godot/imported/mpv-shot0001.jpg-4c0b1d2bc221c05906c91de8aef5b655.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/down-go.png b/Prototypes/tiredbun-prototype-1/player/down-go.png new file mode 100644 index 0000000..4303be8 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/down-go.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/down-go.png.import b/Prototypes/tiredbun-prototype-1/player/down-go.png.import new file mode 100644 index 0000000..7e5090c --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/down-go.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bn3ak3pxua6kr" +path="res://.godot/imported/down-go.png-b7ff3c66c87410b5959fd5814fd1e219.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/down-go.png" +dest_files=["res://.godot/imported/down-go.png-b7ff3c66c87410b5959fd5814fd1e219.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/down-stay.png b/Prototypes/tiredbun-prototype-1/player/down-stay.png new file mode 100644 index 0000000..772cf32 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/down-stay.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/down-stay.png.import b/Prototypes/tiredbun-prototype-1/player/down-stay.png.import new file mode 100644 index 0000000..de54c24 --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/down-stay.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://oblvfn4a7jgr" +path="res://.godot/imported/down-stay.png-8f04363183504ef4c5894d1e8b79ee12.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/down-stay.png" +dest_files=["res://.godot/imported/down-stay.png-8f04363183504ef4c5894d1e8b79ee12.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/lef-go.png b/Prototypes/tiredbun-prototype-1/player/lef-go.png new file mode 100644 index 0000000..7c20f05 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/lef-go.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/lef-go.png.import b/Prototypes/tiredbun-prototype-1/player/lef-go.png.import new file mode 100644 index 0000000..47941c9 --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/lef-go.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cr4m035rj17ob" +path="res://.godot/imported/lef-go.png-c2828610ecd9de079e6e07f438a97f58.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/lef-go.png" +dest_files=["res://.godot/imported/lef-go.png-c2828610ecd9de079e6e07f438a97f58.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/lef-stay.png b/Prototypes/tiredbun-prototype-1/player/lef-stay.png new file mode 100644 index 0000000..1e6c246 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/lef-stay.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/lef-stay.png.import b/Prototypes/tiredbun-prototype-1/player/lef-stay.png.import new file mode 100644 index 0000000..5faf6bd --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/lef-stay.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ryqgr3iw2cna" +path="res://.godot/imported/lef-stay.png-a3c20ee62f036d75022dcd95db3eeec3.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/lef-stay.png" +dest_files=["res://.godot/imported/lef-stay.png-a3c20ee62f036d75022dcd95db3eeec3.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/right-go.png b/Prototypes/tiredbun-prototype-1/player/right-go.png new file mode 100644 index 0000000..afa9d64 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/right-go.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/right-go.png.import b/Prototypes/tiredbun-prototype-1/player/right-go.png.import new file mode 100644 index 0000000..db7a0ce --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/right-go.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bp5p8knf7n06i" +path="res://.godot/imported/right-go.png-cd8d6b25be48ed6058b40787fe95ae2b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/right-go.png" +dest_files=["res://.godot/imported/right-go.png-cd8d6b25be48ed6058b40787fe95ae2b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/right-stay.png b/Prototypes/tiredbun-prototype-1/player/right-stay.png new file mode 100644 index 0000000..07b3af4 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/right-stay.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/right-stay.png.import b/Prototypes/tiredbun-prototype-1/player/right-stay.png.import new file mode 100644 index 0000000..3ede26a --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/right-stay.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d11jduno6wolt" +path="res://.godot/imported/right-stay.png-a18ca84ac15fe311d4b496c1840de0f4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/right-stay.png" +dest_files=["res://.godot/imported/right-stay.png-a18ca84ac15fe311d4b496c1840de0f4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/svg-source.svg b/Prototypes/tiredbun-prototype-1/player/svg-source.svg new file mode 100644 index 0000000..abbd14f --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/svg-source.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + diff --git a/Prototypes/tiredbun-prototype-1/player/svg-source.svg.import b/Prototypes/tiredbun-prototype-1/player/svg-source.svg.import new file mode 100644 index 0000000..a96121e --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/svg-source.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c48c2yny83qej" +path="res://.godot/imported/svg-source.svg-bd6db85edfc66789d837fc500bbcfdd2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/svg-source.svg" +dest_files=["res://.godot/imported/svg-source.svg-bd6db85edfc66789d837fc500bbcfdd2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/Prototypes/tiredbun-prototype-1/player/up-go.png b/Prototypes/tiredbun-prototype-1/player/up-go.png new file mode 100644 index 0000000..26ee715 Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/up-go.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/up-go.png.import b/Prototypes/tiredbun-prototype-1/player/up-go.png.import new file mode 100644 index 0000000..2d964ad --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/up-go.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bup48pdr00h7a" +path="res://.godot/imported/up-go.png-e5f0207e0383e63792b4ff15357b9994.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/up-go.png" +dest_files=["res://.godot/imported/up-go.png-e5f0207e0383e63792b4ff15357b9994.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/player/up-stay.png b/Prototypes/tiredbun-prototype-1/player/up-stay.png new file mode 100644 index 0000000..9b8126d Binary files /dev/null and b/Prototypes/tiredbun-prototype-1/player/up-stay.png differ diff --git a/Prototypes/tiredbun-prototype-1/player/up-stay.png.import b/Prototypes/tiredbun-prototype-1/player/up-stay.png.import new file mode 100644 index 0000000..9f77772 --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/player/up-stay.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://jduoxes2e4uh" +path="res://.godot/imported/up-stay.png-8e04726b54f9d01d6a6c3d28ba13ea99.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Prototypes/tiredbun-prototype-1/player/up-stay.png" +dest_files=["res://.godot/imported/up-stay.png-8e04726b54f9d01d6a6c3d28ba13ea99.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Prototypes/tiredbun-prototype-1/test-scene.tscn b/Prototypes/tiredbun-prototype-1/test-scene.tscn new file mode 100644 index 0000000..fba255a --- /dev/null +++ b/Prototypes/tiredbun-prototype-1/test-scene.tscn @@ -0,0 +1,80 @@ +[gd_scene load_steps=13 format=3 uid="uid://7l1u7y2xvwa6"] + +[ext_resource type="Texture2D" path="res://mpv-shot0001.jpg" id="1_ix3x0"] +[ext_resource type="Script" path="res://Player.gd" id="2_fy1jm"] +[ext_resource type="Texture2D" path="res://player/down-go.png" id="3_hrt1y"] +[ext_resource type="Texture2D" path="res://player/down-stay.png" id="4_fjw2y"] +[ext_resource type="Texture2D" path="res://player/lef-go.png" id="5_rxlf0"] +[ext_resource type="Texture2D" path="res://player/lef-stay.png" id="6_rohwl"] +[ext_resource type="Texture2D" path="res://player/right-go.png" id="7_l3vli"] +[ext_resource type="Texture2D" path="res://player/right-stay.png" id="8_ac52e"] +[ext_resource type="Texture2D" path="res://player/up-go.png" id="9_44ip5"] +[ext_resource type="Texture2D" path="res://player/up-stay.png" id="10_ddtxv"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ggyph"] +size = Vector2(60, 60) + +[sub_resource type="SpriteFrames" id="SpriteFrames_yher1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("4_fjw2y") +}, { +"duration": 1.0, +"texture": ExtResource("3_hrt1y") +}], +"loop": true, +"name": &"down-go", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("6_rohwl") +}, { +"duration": 1.0, +"texture": ExtResource("5_rxlf0") +}], +"loop": true, +"name": &"left-go", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("8_ac52e") +}, { +"duration": 1.0, +"texture": ExtResource("7_l3vli") +}], +"loop": true, +"name": &"right-go", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("10_ddtxv") +}, { +"duration": 1.0, +"texture": ExtResource("9_44ip5") +}], +"loop": true, +"name": &"up-go", +"speed": 5.0 +}] + +[node name="Node2D" type="Node2D"] + +[node name="Mpv-shot0001" type="Sprite2D" parent="."] +position = Vector2(577.222, 323.75) +scale = Vector2(0.604167, 0.604167) +texture = ExtResource("1_ix3x0") + +[node name="Player" type="CharacterBody2D" parent="."] +position = Vector2(162, 125) +script = ExtResource("2_fy1jm") + +[node name="PlayerCollision" type="CollisionShape2D" parent="Player"] +shape = SubResource("RectangleShape2D_ggyph") + +[node name="PlayerSprite" type="AnimatedSprite2D" parent="Player"] +sprite_frames = SubResource("SpriteFrames_yher1") +animation = &"down-go" diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..309a084 --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw6xg6i1ndmus" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..9326d99 --- /dev/null +++ b/project.godot @@ -0,0 +1,20 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="FluffyFloofGamePrototype" +config/features=PackedStringArray("4.1", "GL Compatibility") +config/icon="res://icon.svg" + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility"