diff --git a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index c574e5f..b3b3605 100644 --- a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg +++ b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Area2D")]) +selected_nodes=Array[NodePath]([]) diff --git a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg index 6918fec..86add5d 100644 --- a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg +++ b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Area2D")]) +selected_nodes=Array[NodePath]([]) diff --git a/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg index 780ff38..a8ca307 100644 --- a/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg +++ b/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg @@ -1,5 +1,5 @@ [folding] -node_unfolds=[] -resource_unfolds=["res://scenes/character.tscn::CircleShape2D_ubfw4", PackedStringArray()] +node_unfolds=[NodePath("AnimatedSprite2D"), PackedStringArray("Animation", "sprite_frames", "Texture")] +resource_unfolds=["res://scenes/character.tscn::SpriteFrames_h7tsu", PackedStringArray("Resource"), "res://scenes/character.tscn::CircleShape2D_ubfw4", PackedStringArray()] nodes_folded=[] diff --git a/.godot/editor/create_recent.Node b/.godot/editor/create_recent.Node index 56a4f42..66d0f70 100644 --- a/.godot/editor/create_recent.Node +++ b/.godot/editor/create_recent.Node @@ -1,3 +1,4 @@ +AnimatedSprite2D Node2D CollisionShape2D Area2D diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index 7d28206..7641bc6 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -4,12 +4,12 @@ dock_1_selected_tab_idx=0 dock_2_selected_tab_idx=0 dock_3_selected_tab_idx=0 dock_4_selected_tab_idx=0 -dock_5_selected_tab_idx=1 +dock_5_selected_tab_idx=0 dock_6_selected_tab_idx=0 dock_7_selected_tab_idx=0 dock_8_selected_tab_idx=0 dock_floating={} -dock_split_2=0 +dock_split_2=-77 dock_split_3=0 dock_hsplit_1=0 dock_hsplit_2=270 @@ -19,8 +19,8 @@ dock_filesystem_split=0 dock_filesystem_display_mode=0 dock_filesystem_file_sort=0 dock_filesystem_file_list_display_mode=1 -dock_filesystem_selected_paths=PackedStringArray("res://scenes/bullet.tscn") -dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/") +dock_filesystem_selected_paths=PackedStringArray("res://graphics/Player Idle 48x48.png") +dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://graphics/") dock_3="Scene,Import" dock_4="FileSystem" dock_5="Inspector,Node,History" @@ -28,16 +28,16 @@ dock_5="Inspector,Node,History" [EditorNode] open_scenes=PackedStringArray("res://scenes/game.tscn", "res://scenes/character.tscn", "res://scenes/bullet.tscn") -current_scene="res://scenes/bullet.tscn" +current_scene="res://scenes/character.tscn" center_split_offset=0 selected_default_debugger_tab_idx=0 selected_main_editor_idx=2 -selected_bottom_panel_item=0 +selected_bottom_panel_item=9 [ScriptEditor] open_scripts=["res://scripts/bullet.gd", "res://scripts/CharacterBody2D.gd", "res://scripts/gamecontroller.gd"] -selected_script="res://scripts/bullet.gd" +selected_script="res://scripts/CharacterBody2D.gd" open_help=[] script_split_offset=70 list_split_offset=0 diff --git a/.godot/editor/favorites b/.godot/editor/favorites new file mode 100644 index 0000000..e69de29 diff --git a/.godot/editor/filesystem_cache8 b/.godot/editor/filesystem_cache8 index f5c988c..2fe8b4f 100644 --- a/.godot/editor/filesystem_cache8 +++ b/.godot/editor/filesystem_cache8 @@ -1,9 +1,17 @@ ea4bc82a6ad023ab7ee23ee620429895 -::res://::1721083613 -icon.svg::CompressedTexture2D::9114977118871582245::1721083376::1721083376::1::::<><>:: -::res://scenes/::1721083376 -game.tscn::PackedScene::1738196330916037717::1721083376::0::1::::<><>::res://scripts/gamecontroller.gd<>res://scripts/CharacterBody2D.gd<>res://scripts/Trigger.gd -::res://scripts/::1721083376 -CharacterBody2D.gd::GDScript::-1::1721083376::0::1::::<>CharacterBody2D<>:: -gamecontroller.gd::GDScript::-1::1721083376::0::1::::<>Node2D<>:: -Trigger.gd::GDScript::-1::1721083376::0::1::::<>Area2D<>:: +::res://::1721688521 +icon.svg::CompressedTexture2D::9114977118871582245::1721682499::1721682499::1::::<><>:: +README.md::TextFile::-1::1721686814::0::1::::<><>:: +::res://graphics/::1721690749 +Player Idle 48x48.png::CompressedTexture2D::3034784150585975320::1721688486::1721688521::1::::<><>:: +player jump 48x48.png::CompressedTexture2D::5342238035347045068::1721690749::1721690749::1::::<><>:: +player run 48x48.png::CompressedTexture2D::3468292145757083245::1721689940::1721689940::1::::<><>:: +::res://scenes/::1721690574 +bullet.tscn::PackedScene::6880909734590904373::1721690574::0::1::::<><>::res://scripts/bullet.gd +character.tscn::PackedScene::451838158579532324::1721690574::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://bjicpmau1iy7y::::res://graphics/Player Idle 48x48.png<>uid://bpocjaij352uj::::res://graphics/player run 48x48.png +game.tscn::PackedScene::1738196330916037717::1721690574::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>res://scripts/Trigger.gd +::res://scripts/::1721690574 +bullet.gd::GDScript::-1::1721682499::0::1::::<>Area2D<>:: +CharacterBody2D.gd::GDScript::-1::1721690574::0::1::::<>CharacterBody2D<>:: +gamecontroller.gd::GDScript::-1::1721682499::0::1::::<>Node2D<>:: +Trigger.gd::GDScript::-1::1721682499::0::1::::<>Area2D<>:: diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index 2b708c4..acb0fcf 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -1,5 +1,4 @@ res://scenes/game.tscn -res://scripts/CharacterBody2D.gd res://scenes/character.tscn -res://scripts/bullet.gd res://scenes/bullet.tscn +res://scripts/CharacterBody2D.gd diff --git a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg index 5c855c4..0cb9104 100644 --- a/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg +++ b/.godot/editor/game.tscn-editstate-c2a7af834e91ff64325daddf58e45dc0.cfg @@ -172,4 +172,4 @@ Anim={ "zfar": 4000.01, "znear": 0.05 } -selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@17140/@Panel@13/@VBoxContainer@14/@HSplitContainer@17/@HSplitContainer@25/@HSplitContainer@33/@VBoxContainer@34/@VSplitContainer@36/@VSplitContainer@62/@VBoxContainer@63/@PanelContainer@110/MainScreen/@CanvasItemEditor@9462/@VSplitContainer@9281/@HSplitContainer@9283/@HSplitContainer@9285/@Control@9286/@SubViewportContainer@9287/@SubViewport@9288/Area2D")]) +selected_nodes=Array[NodePath]([]) diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index faa3f2c..664dd4b 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -23,6 +23,7 @@ CollisionShape2D:scale=true RigidBody2D:scale=true RayCast2D:scale=true Area2D:scale=true +AnimatedSprite2D:scale=true [dialog_bounds] diff --git a/.godot/editor/recent_dirs b/.godot/editor/recent_dirs index 0cc5aaa..6c5985a 100644 --- a/.godot/editor/recent_dirs +++ b/.godot/editor/recent_dirs @@ -1,2 +1,3 @@ +res://graphics res://scripts res://scenes diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index 2b6b7f0..70664d6 100644 --- a/.godot/editor/script_editor_cache.cfg +++ b/.godot/editor/script_editor_cache.cfg @@ -17,11 +17,11 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 52, +"column": 30, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 47, -"scroll_position": 30.0, +"row": 69, +"scroll_position": 56.0, "selection": false, "syntax_highlighter": "GDScript" } diff --git a/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex b/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex new file mode 100644 index 0000000..25ed9e3 Binary files /dev/null and b/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex differ diff --git a/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.md5 b/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.md5 new file mode 100644 index 0000000..3dd0db8 --- /dev/null +++ b/.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.md5 @@ -0,0 +1,3 @@ +source_md5="25eca82a8943e0cb7df742fc2f8287eb" +dest_md5="40424c46e7e7da6cb6f8f38becacd5fa" + diff --git a/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.ctex b/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.ctex new file mode 100644 index 0000000..25ed9e3 Binary files /dev/null and b/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.ctex differ diff --git a/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.md5 b/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.md5 new file mode 100644 index 0000000..3dd0db8 --- /dev/null +++ b/.godot/imported/Player Idle 48x48.png-e8e7ab7fcf5572b88387a2fca249a12b.md5 @@ -0,0 +1,3 @@ +source_md5="25eca82a8943e0cb7df742fc2f8287eb" +dest_md5="40424c46e7e7da6cb6f8f38becacd5fa" + diff --git a/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex b/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex new file mode 100644 index 0000000..dece7b1 Binary files /dev/null and b/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex differ diff --git a/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.md5 b/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.md5 new file mode 100644 index 0000000..c3a4d5b --- /dev/null +++ b/.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.md5 @@ -0,0 +1,3 @@ +source_md5="32c25d5ee4a6233bebc766fa35137e71" +dest_md5="e2c6a646cfe3495563ee0fd7127f6784" + diff --git a/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex b/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex new file mode 100644 index 0000000..ccf024f Binary files /dev/null and b/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex differ diff --git a/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.md5 b/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.md5 new file mode 100644 index 0000000..f9bbe2d --- /dev/null +++ b/.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.md5 @@ -0,0 +1,3 @@ +source_md5="01ad20affe3a719d2248d3eb59a0b3dd" +dest_md5="c7e49f2c0ac84ac6a6d941074f19bd68" + diff --git a/.godot/uid_cache.bin b/.godot/uid_cache.bin index 33dc351..c345553 100644 Binary files a/.godot/uid_cache.bin and b/.godot/uid_cache.bin differ diff --git a/graphics/Player Idle 48x48.png b/graphics/Player Idle 48x48.png new file mode 100644 index 0000000..b618511 Binary files /dev/null and b/graphics/Player Idle 48x48.png differ diff --git a/graphics/Player Idle 48x48.png.import b/graphics/Player Idle 48x48.png.import new file mode 100644 index 0000000..78a2c72 --- /dev/null +++ b/graphics/Player Idle 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjicpmau1iy7y" +path="res://.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/Player Idle 48x48.png" +dest_files=["res://.godot/imported/Player Idle 48x48.png-b25968a287377bab7d6899f33fed0ec9.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/graphics/player jump 48x48.png b/graphics/player jump 48x48.png new file mode 100644 index 0000000..dff105c Binary files /dev/null and b/graphics/player jump 48x48.png differ diff --git a/graphics/player jump 48x48.png.import b/graphics/player jump 48x48.png.import new file mode 100644 index 0000000..c368b57 --- /dev/null +++ b/graphics/player jump 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cid246g3bgt7a" +path="res://.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/player jump 48x48.png" +dest_files=["res://.godot/imported/player jump 48x48.png-44bab2151e6e1eb3cf69ed16e7a4f4ad.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/graphics/player run 48x48.png b/graphics/player run 48x48.png new file mode 100644 index 0000000..aca5b55 Binary files /dev/null and b/graphics/player run 48x48.png differ diff --git a/graphics/player run 48x48.png.import b/graphics/player run 48x48.png.import new file mode 100644 index 0000000..d9697ce --- /dev/null +++ b/graphics/player run 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpocjaij352uj" +path="res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://graphics/player run 48x48.png" +dest_files=["res://.godot/imported/player run 48x48.png-626defb011aee5b3f5c54d9acb45d5f5.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/scenes/character.tscn b/scenes/character.tscn index 58205a8..060cfe4 100644 --- a/scenes/character.tscn +++ b/scenes/character.tscn @@ -1,18 +1,194 @@ -[gd_scene load_steps=3 format=3 uid="uid://go4yc8hfo1gq"] +[gd_scene load_steps=28 format=3 uid="uid://go4yc8hfo1gq"] [ext_resource type="Script" path="res://scripts/CharacterBody2D.gd" id="1_x87yo"] +[ext_resource type="Texture2D" uid="uid://bjicpmau1iy7y" path="res://graphics/Player Idle 48x48.png" id="2_re2it"] +[ext_resource type="Texture2D" uid="uid://bpocjaij352uj" path="res://graphics/player run 48x48.png" id="3_4gwja"] +[ext_resource type="Texture2D" uid="uid://cid246g3bgt7a" path="res://graphics/player jump 48x48.png" id="3_h032e"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_bkvw7"] +atlas = ExtResource("2_re2it") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2oy63"] +atlas = ExtResource("2_re2it") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q4cvr"] +atlas = ExtResource("2_re2it") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ib3dq"] +atlas = ExtResource("2_re2it") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kdna3"] +atlas = ExtResource("2_re2it") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_muups"] +atlas = ExtResource("2_re2it") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nkvak"] +atlas = ExtResource("2_re2it") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fxl5c"] +atlas = ExtResource("2_re2it") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pnqri"] +atlas = ExtResource("2_re2it") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i6dxl"] +atlas = ExtResource("2_re2it") +region = Rect2(432, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fxixe"] +atlas = ExtResource("3_h032e") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mvx11"] +atlas = ExtResource("3_h032e") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a2bf2"] +atlas = ExtResource("3_h032e") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7ad6o"] +atlas = ExtResource("3_4gwja") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yoh57"] +atlas = ExtResource("3_4gwja") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rtw0v"] +atlas = ExtResource("3_4gwja") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_abqek"] +atlas = ExtResource("3_4gwja") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fqjri"] +atlas = ExtResource("3_4gwja") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f8bsf"] +atlas = ExtResource("3_4gwja") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xgued"] +atlas = ExtResource("3_4gwja") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_six34"] +atlas = ExtResource("3_4gwja") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="SpriteFrames" id="SpriteFrames_h7tsu"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_bkvw7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2oy63") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_q4cvr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ib3dq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kdna3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_muups") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nkvak") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fxl5c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pnqri") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i6dxl") +}], +"loop": true, +"name": &"idle", +"speed": 15.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_fxixe") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mvx11") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_a2bf2") +}], +"loop": false, +"name": &"jump", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_7ad6o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yoh57") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_rtw0v") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_abqek") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fqjri") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f8bsf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xgued") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_six34") +}], +"loop": true, +"name": &"run", +"speed": 15.0 +}] [sub_resource type="CircleShape2D" id="CircleShape2D_ubfw4"] -radius = 13.0384 +radius = 11.0 [node name="CharacterBody2D" type="CharacterBody2D"] position = Vector2(-1, 0) script = ExtResource("1_x87yo") JUMP_VELOCITY = -500.0 PUSH_FORCE = 200 -metadata/_edit_group_ = true + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_h7tsu") +animation = &"jump" +autoplay = "idle" +frame = 2 +frame_progress = 1.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 5) shape = SubResource("CircleShape2D_ubfw4") [node name="RightRay" type="RayCast2D" parent="."] diff --git a/scripts/CharacterBody2D.gd b/scripts/CharacterBody2D.gd index 4ea0614..cc6ebc9 100644 --- a/scripts/CharacterBody2D.gd +++ b/scripts/CharacterBody2D.gd @@ -10,6 +10,7 @@ extends CharacterBody2D @onready var left_ray = $LeftRay @onready var marker_right = $MarkerRight @onready var marker_left = $MarkerLeft +@onready var animated_sprite = $AnimatedSprite2D var faceLeft = false var pushLeftEnabled = false @@ -57,8 +58,16 @@ func _physics_process(delta): if direction: velocity.x = direction * SPEED + animated_sprite.flip_h = true if direction <0 else false else: velocity.x = move_toward(velocity.x, 0, SPEED) + if is_on_floor(): + if direction == 0: + animated_sprite.play("idle") + else: + animated_sprite.play("run") + else: + animated_sprite.play("jump") move_and_slide() if right_ray.is_colliding():