diff --git a/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg b/.godot/editor/bullet.tscn-editstate-6d8e6ff1e6f20a36e0402d27c623c86c.cfg index c574e5f..915d802 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]([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/CharacterBody2D/AnimatedSprite2D")]) diff --git a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg index 6918fec..3f68387 100644 --- a/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg +++ b/.godot/editor/character.tscn-editstate-b6bd7a241034177d7fe082a7597ba8ea.cfg @@ -8,7 +8,7 @@ Anim={ "grid_snap_active": false, "grid_step": Vector2(8, 8), "grid_visibility": 1, -"ofs": Vector2(-105.112, -79.4505), +"ofs": Vector2(-103.237, -64.8437), "primary_grid_step": Vector2i(8, 8), "show_edit_locks": true, "show_guides": true, @@ -32,7 +32,7 @@ Anim={ "snap_rotation_step": 0.261799, "snap_scale": false, "snap_scale_step": 0.1, -"zoom": 4.23785 +"zoom": 4.75683 } 3D={ "fov": 70.01, @@ -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]([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/CharacterBody2D/AnimatedSprite2D")]) diff --git a/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg b/.godot/editor/character.tscn-folding-b6bd7a241034177d7fe082a7597ba8ea.cfg index 780ff38..edfe493 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_8idir", 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..77dbfef 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -4,7 +4,7 @@ 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 @@ -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() +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_main_editor_idx=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/filesystem_cache8 b/.godot/editor/filesystem_cache8 index f5c988c..ac14a17 100644 --- a/.godot/editor/filesystem_cache8 +++ b/.godot/editor/filesystem_cache8 @@ -1,9 +1,18 @@ 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://::1721688548 +icon.svg::CompressedTexture2D::9114977118871582245::1721682499::1721682499::1::::<><>:: +README.md::TextFile::-1::1721686817::0::1::::<><>:: +::res://graphics/::1721691245 +Player Idle 48x48.png::CompressedTexture2D::3529809544777189649::1721688527::1721688496::1::::<><>:: +player jump 48x48.png::CompressedTexture2D::3342890448265989669::1721690657::1721690657::1::::<><>:: +player land 48x48.png::CompressedTexture2D::5541143191019734946::1721691245::1721691245::1::::<><>:: +player run 48x48.png::CompressedTexture2D::2400852804432818940::1721689939::1721689939::1::::<><>:: +::res://scenes/::1721691227 +bullet.tscn::PackedScene::6880909734590904373::1721691227::0::1::::<><>::res://scripts/bullet.gd +character.tscn::PackedScene::451838158579532324::1721691227::0::1::::<><>::res://scripts/CharacterBody2D.gd<>uid://bqj4phkget2pp::::res://graphics/Player Idle 48x48.png<>uid://bnvk6gm188vsv::::res://graphics/player jump 48x48.png<>uid://bag8xvlev6yxg::::res://graphics/player run 48x48.png +game.tscn::PackedScene::1738196330916037717::1721691227::0::1::::<><>::res://scripts/gamecontroller.gd<>uid://go4yc8hfo1gq::::res://scenes/character.tscn<>res://scripts/Trigger.gd +::res://scripts/::1721691227 +bullet.gd::GDScript::-1::1721682499::0::1::::<>Area2D<>:: +CharacterBody2D.gd::GDScript::-1::1721691227::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..bc1e6a7 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]([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/CharacterBody2D/AnimatedSprite2D")]) diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index faa3f2c..54c45ff 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -1,6 +1,6 @@ [editor_metadata] -executable_path="/home/timbot/Documents/Software/godot/Godot_v4.2.1-stable_linux.x86_64" +executable_path="/home/timbuntu/Documents/software/godot/Godot_v4.2.1-stable_linux.x86_64" use_advanced_connections=false [debug_options] @@ -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..5c93079 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": 51.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.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 land 48x48.png-7d2e3d636a316a58b0744c2ca9004ab0.md5 b/.godot/imported/player land 48x48.png-7d2e3d636a316a58b0744c2ca9004ab0.md5 new file mode 100644 index 0000000..5c77568 --- /dev/null +++ b/.godot/imported/player land 48x48.png-7d2e3d636a316a58b0744c2ca9004ab0.md5 @@ -0,0 +1,3 @@ +source_md5="6499731a5b8ba07779f39a50ca1cf8b1" +dest_md5="ee57d845fdcb15a719035fe5911e8bdc" + 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..71012ca 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..3f0eea2 --- /dev/null +++ b/graphics/Player Idle 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqj4phkget2pp" +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..a495350 --- /dev/null +++ b/graphics/player jump 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bnvk6gm188vsv" +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..955749b --- /dev/null +++ b/graphics/player run 48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bag8xvlev6yxg" +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/project.godot b/project.godot index a0fbc79..9cc34dc 100644 --- a/project.godot +++ b/project.godot @@ -19,6 +19,7 @@ config/icon="res://icon.svg" folder_colors={ "res://assets/": "green", +"res://graphics/": "green", "res://scenes/": "yellow", "res://scripts/": "red" } diff --git a/scenes/character.tscn b/scenes/character.tscn index 58205a8..03e2276 100644 --- a/scenes/character.tscn +++ b/scenes/character.tscn @@ -1,18 +1,193 @@ -[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://bqj4phkget2pp" path="res://graphics/Player Idle 48x48.png" id="2_c7awu"] +[ext_resource type="Texture2D" uid="uid://bnvk6gm188vsv" path="res://graphics/player jump 48x48.png" id="3_h6vre"] +[ext_resource type="Texture2D" uid="uid://bag8xvlev6yxg" path="res://graphics/player run 48x48.png" id="3_w6p3w"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_aeg01"] +atlas = ExtResource("2_c7awu") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1uaof"] +atlas = ExtResource("2_c7awu") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gt6ba"] +atlas = ExtResource("2_c7awu") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tay2c"] +atlas = ExtResource("2_c7awu") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1ag8q"] +atlas = ExtResource("2_c7awu") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hjiy4"] +atlas = ExtResource("2_c7awu") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_82onf"] +atlas = ExtResource("2_c7awu") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yqp8u"] +atlas = ExtResource("2_c7awu") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_m6d3n"] +atlas = ExtResource("2_c7awu") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ax7e1"] +atlas = ExtResource("2_c7awu") +region = Rect2(432, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qrer8"] +atlas = ExtResource("3_h6vre") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wpiaq"] +atlas = ExtResource("3_h6vre") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kc70w"] +atlas = ExtResource("3_h6vre") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i4hpn"] +atlas = ExtResource("3_w6p3w") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sri3h"] +atlas = ExtResource("3_w6p3w") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_igbwk"] +atlas = ExtResource("3_w6p3w") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t7p31"] +atlas = ExtResource("3_w6p3w") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ovti0"] +atlas = ExtResource("3_w6p3w") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2vy0d"] +atlas = ExtResource("3_w6p3w") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_klr2a"] +atlas = ExtResource("3_w6p3w") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ax6e1"] +atlas = ExtResource("3_w6p3w") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="SpriteFrames" id="SpriteFrames_8idir"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_aeg01") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1uaof") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gt6ba") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tay2c") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_1ag8q") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hjiy4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_82onf") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yqp8u") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_m6d3n") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ax7e1") +}], +"loop": true, +"name": &"idle", +"speed": 15.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_qrer8") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wpiaq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kc70w") +}], +"loop": false, +"name": &"jump", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_i4hpn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_sri3h") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_igbwk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t7p31") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ovti0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2vy0d") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_klr2a") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ax6e1") +}], +"loop": true, +"name": &"run", +"speed": 15.0 +}] [sub_resource type="CircleShape2D" id="CircleShape2D_ubfw4"] -radius = 13.0384 +radius = 12.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_8idir") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.758732 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2(0, 3) 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():