diff --git a/Assets/world_tileset.png b/Assets/world_tileset.png new file mode 100644 index 0000000..36bbf07 Binary files /dev/null and b/Assets/world_tileset.png differ diff --git a/Assets/world_tileset.png.import b/Assets/world_tileset.png.import new file mode 100644 index 0000000..fd20b38 --- /dev/null +++ b/Assets/world_tileset.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bi65nnl7y32vr" +path="res://.godot/imported/world_tileset.png-aac1170b2f3c785c1a10006f5d535e73.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/world_tileset.png" +dest_files=["res://.godot/imported/world_tileset.png-aac1170b2f3c785c1a10006f5d535e73.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/main_city.tscn b/Scenes/main_city.tscn index fcad76d..253d2cf 100644 --- a/Scenes/main_city.tscn +++ b/Scenes/main_city.tscn @@ -1,209 +1,176 @@ -[gd_scene format=3 uid="uid://c7mlj78rqvqm8"] +[gd_scene format=4 uid="uid://c7mlj78rqvqm8"] -[ext_resource type="Texture2D" uid="uid://bdnlkki3bx8k8" path="res://Assets/knight.png" id="1_aw1cc"] [ext_resource type="Script" uid="uid://cy8lexg74assu" path="res://Scripts/game_controller.gd" id="2_36lpk"] [ext_resource type="PackedScene" uid="uid://dbbi4qwe2t2ee" path="res://Scenes/player.tscn" id="3_3ucv7"] +[ext_resource type="Texture2D" uid="uid://bi65nnl7y32vr" path="res://Assets/world_tileset.png" id="3_aw1cc"] -[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_psxkc"] -texture = ExtResource("1_aw1cc") +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_36lpk"] +texture = ExtResource("3_aw1cc") 0:0/0 = 0 +0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 1:0/0 = 0 +1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 2:0/0 = 0 +2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 3:0/0 = 0 +3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 4:0/0 = 0 +4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 5:0/0 = 0 +5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 6:0/0 = 0 +6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 7:0/0 = 0 +7:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 8:0/0 = 0 +8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 9:0/0 = 0 +9:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 0.8992939, -8, -0.35971642) 10:0/0 = 0 +10:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -6.115196, 8, 0.8992939, -8, 0.8992939) +11:0/0 = 0 +11:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -8, 8, -1.2590103, -8, 0.8992939) 0:1/0 = 0 +0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 1:1/0 = 0 +1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 2:1/0 = 0 +2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 3:1/0 = 0 +3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 4:1/0 = 0 +4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 5:1/0 = 0 +5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 6:1/0 = 0 +6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 7:1/0 = 0 +7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 8:1/0 = 0 +8:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 9:1/0 = 0 +9:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 0.8992939, -8, -0.35971642) 10:1/0 = 0 +10:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -6.115196, 8, 0.8992939, -8, 0.8992939) +11:1/0 = 0 +11:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -8, 8, -1.2590103, -8, 0.8992939) 0:2/0 = 0 +0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 1:2/0 = 0 +1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 2:2/0 = 0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +3:2/0 = 0 +3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +4:2/0 = 0 +4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +5:2/0 = 0 +5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +6:2/0 = 0 +6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +7:2/0 = 0 +7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +8:2/0 = 0 +8:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +9:2/0 = 0 +9:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 0.8992939, -8, -0.35971642) +10:2/0 = 0 +10:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -6.115196, 8, 0.8992939, -8, 0.8992939) +11:2/0 = 0 +11:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -6.115196, 8, -8, 8, -1.2590103, -8, 0.8992939) 0:3/0 = 0 1:3/0 = 0 2:3/0 = 0 +5:3/0 = 0 +6:3/0 = 0 +7:3/0 = 0 +7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) +8:3/0 = 0 +9:3/0 = 0 0:4/0 = 0 1:4/0 = 0 -2:4/0 = 0 -3:4/0 = 0 -4:4/0 = 0 5:4/0 = 0 6:4/0 = 0 7:4/0 = 0 +7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) 8:4/0 = 0 9:4/0 = 0 -10:4/0 = 0 -11:4/0 = 0 -12:4/0 = 0 -13:4/0 = 0 -14:4/0 = 0 -15:4/0 = 0 0:5/0 = 0 1:5/0 = 0 -2:5/0 = 0 -3:5/0 = 0 -4:5/0 = 0 5:5/0 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:12/0 = 0 -9:12/0 = 0 -10:12/0 = 0 0:13/0 = 0 1:13/0 = 0 2:13/0 = 0 3:13/0 = 0 4:13/0 = 0 5:13/0 = 0 -6:13/0 = 0 -7:13/0 = 0 -8:13/0 = 0 -9:13/0 = 0 -10:13/0 = 0 0:14/0 = 0 1:14/0 = 0 2:14/0 = 0 3:14/0 = 0 4:14/0 = 0 -5:14/0 = 0 -8:14/0 = 0 -9:14/0 = 0 -10:14/0 = 0 -11:14/0 = 0 -11:14/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 2.358295, 8, 2.4413967, 8, 8, -8, 8) -12:14/0 = 0 0:15/0 = 0 1:15/0 = 0 2:15/0 = 0 3:15/0 = 0 -4:15/0 = 0 -5:15/0 = 0 -6:15/0 = 0 -7:15/0 = 0 -8:15/0 = 0 -9:15/0 = 0 -10:15/0 = 0 -11:15/0 = 0 -12:15/0 = 0 -6:14/0 = 0 -7:14/0 = 0 -5:24/0 = 0 -6:24/0 = 0 -4:21/0 = 0 -4:22/0 = 0 -4:23/0 = 0 -4:24/0 = 0 -4:25/0 = 0 -4:26/0 = 0 +2:4/size_in_atlas = Vector2i(3, 3) +2:4/0 = 0 -[sub_resource type="TileSet" id="TileSet_ye2d0"] +[sub_resource type="TileSet" id="TileSet_3ucv7"] physics_layer_0/collision_layer = 1 -sources/0 = SubResource("TileSetAtlasSource_psxkc") +sources/0 = SubResource("TileSetAtlasSource_36lpk") [node name="MainCity" type="Node2D" unique_id=864897235] -[node name="TileMap" type="TileMap" parent="." unique_id=274794155] -tile_set = SubResource("TileSet_ye2d0") -format = 2 -layer_0/tile_data = PackedInt32Array(65535, 720896, 14, 0, 720896, 14, 1, 720896, 14, 2, 720896, 14, 3, 720896, 14, 65534, 720896, 14, 65533, 720896, 14, 65532, 720896, 14, 4, 720896, 14, 5, 720896, 14, 6, 720896, 14, 7, 720896, 14, 8, 720896, 14, 9, 720896, 14, 10, 720896, 14, 11, 720896, 14, 12, 720896, 14, 13, 720896, 14, -65523, 720896, 14, -65522, 720896, 14, 14, 720896, 14, 15, 720896, 14, 16, 720896, 14, 17, 720896, 14, 18, 720896, 14, 19, 720896, 14, 20, 720896, 14, 21, 720896, 14, 22, 720896, 14, 23, 720896, 14, 65560, 720896, 14, 65561, 720896, 14, 65562, 720896, 14, 26, 720896, 14, 27, 720896, 14, 28, 720896, 14, 29, 720896, 14, 30, 720896, 14, 31, 720896, 14, 32, 720896, 14, 33, 720896, 14, 34, 720896, 14, 35, 720896, 14, 36, 720896, 14, 37, 720896, 14, 38, 720896, 14, 39, 720896, 14, 40, 720896, 14, 41, 720896, 14, 42, 720896, 14, 43, 720896, 14, 44, 720896, 14, 45, 720896, 14, 46, 720896, 14, 47, 720896, 14, 48, 720896, 14, 49, 720896, 14, 50, 720896, 14, 51, 720896, 14, 52, 720896, 14, 53, 720896, 14, 54, 720896, 14, 55, 720896, 14, -65480, 720896, 14, -65479, 720896, 14, -65478, 720896, 14, -65477, 720896, 14, 65531, 720896, 14, 65530, 720896, 14, 65529, 720896, 14, 65528, 720896, 14, 65527, 720896, 14, 65526, 720896, 14, 65525, 720896, 14, 65524, 720896, 14, 65523, 720896, 14, 65522, 720896, 14, -131059, 720896, 14, -196595, 720896, 14, -262131, 720896, 14, -131061, 720896, 14, -196597, 720896, 14, -262133, 720896, 14, -327669, 720896, 14, -393205, 720896, 14, -458739, 720896, 14, -524275, 720896, 14, -589811, 720896, 14, -458741, 720896, 14, -589814, 720896, 14, -655350, 720896, 14, -720886, 720896, 14, -786422, 720896, 14, -851958, 720896, 14) - -[node name="CollisionShape2D" type="CollisionShape2D" parent="TileMap" unique_id=88050852] - [node name="GameController" type="Node" parent="." unique_id=1789674633] script = ExtResource("2_36lpk") @@ -211,3 +178,7 @@ script = ExtResource("2_36lpk") [node name="Camera2D" type="Camera2D" parent="Player" unique_id=1465499206] zoom = Vector2(4, 4) + +[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=241403135] +tile_map_data = PackedByteArray("AADy/wEAAAA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AAAAAAAAAAAA1AAAAAAAAAAAAAAA2AAAAAAAAAAAAAAA3AAAAAAAAAAAAAAA4AP//AAAAAAAAAAA5AP//AAAAAAAAAAA6AP//AAAAAAAAAAA7AP//AAAAAAAAAAAOAP//AAAAAAAAAAANAP//AAAAAAEAAAANAP7/AAAAAAEAAAANAP3/AAAAAAEAAAANAPz/AAAAAAAAAAALAP7/AAAAAAEAAAALAP3/AAAAAAEAAAALAPz/AAAAAAEAAAALAPv/AAAAAAEAAAALAPr/AAAAAAEAAAANAPn/AAAAAAEAAAANAPj/AAAAAAEAAAAKAPf/AAAAAAEAAAAKAPb/AAAAAAEAAAAKAPX/AAAAAAEAAAAKAPT/AAAAAAEAAAALAPn/AAAAAAAAAAANAPf/AAAAAAAAAAAKAPP/AAAAAAAAAAA=") +tile_set = SubResource("TileSet_3ucv7") diff --git a/Scenes/player.tscn b/Scenes/player.tscn index be6a627..413bfb8 100644 --- a/Scenes/player.tscn +++ b/Scenes/player.tscn @@ -3,18 +3,360 @@ [ext_resource type="Script" uid="uid://dvns26kbc7afy" path="res://Scripts/player.gd" id="1_v0iea"] [ext_resource type="Texture2D" uid="uid://bdnlkki3bx8k8" path="res://Assets/knight.png" id="2_cvnsp"] +[sub_resource type="AtlasTexture" id="AtlasTexture_sbwqj"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xwi16"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 0, 32, 32) + [sub_resource type="AtlasTexture" id="AtlasTexture_6t5aa"] atlas = ExtResource("2_cvnsp") region = Rect2(0, 0, 32, 32) +[sub_resource type="AtlasTexture" id="AtlasTexture_cvnsp"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vgqql"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fkybt"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x3wgy"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 0, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_sweqm"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ph33w"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7ldla"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_r7t2e"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nmr2m"] +atlas = ExtResource("2_cvnsp") +region = Rect2(128, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ax3m3"] +atlas = ExtResource("2_cvnsp") +region = Rect2(160, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3vlem"] +atlas = ExtResource("2_cvnsp") +region = Rect2(192, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8eeqe"] +atlas = ExtResource("2_cvnsp") +region = Rect2(224, 160, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3smsa"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8erm5"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f1ek2"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tx1dd"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gymyn"] +atlas = ExtResource("2_cvnsp") +region = Rect2(128, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pu2lt"] +atlas = ExtResource("2_cvnsp") +region = Rect2(160, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ukyrk"] +atlas = ExtResource("2_cvnsp") +region = Rect2(192, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7dp3o"] +atlas = ExtResource("2_cvnsp") +region = Rect2(224, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_h4iuc"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fd4e3"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qqcod"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_igrcy"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fs7ks"] +atlas = ExtResource("2_cvnsp") +region = Rect2(128, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l6n3p"] +atlas = ExtResource("2_cvnsp") +region = Rect2(160, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_olqyp"] +atlas = ExtResource("2_cvnsp") +region = Rect2(192, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wpjfl"] +atlas = ExtResource("2_cvnsp") +region = Rect2(224, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_bi64h"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2ijsl"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_p1odr"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_0gysh"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vfarp"] +atlas = ExtResource("2_cvnsp") +region = Rect2(128, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y6uwr"] +atlas = ExtResource("2_cvnsp") +region = Rect2(160, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_83xs0"] +atlas = ExtResource("2_cvnsp") +region = Rect2(192, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ypfnu"] +atlas = ExtResource("2_cvnsp") +region = Rect2(224, 64, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xuaoq"] +atlas = ExtResource("2_cvnsp") +region = Rect2(0, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wohnl"] +atlas = ExtResource("2_cvnsp") +region = Rect2(32, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_36dho"] +atlas = ExtResource("2_cvnsp") +region = Rect2(64, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_yh6i2"] +atlas = ExtResource("2_cvnsp") +region = Rect2(96, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nv4vc"] +atlas = ExtResource("2_cvnsp") +region = Rect2(128, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8gxox"] +atlas = ExtResource("2_cvnsp") +region = Rect2(160, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_11gg7"] +atlas = ExtResource("2_cvnsp") +region = Rect2(192, 96, 32, 32) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qpa8y"] +atlas = ExtResource("2_cvnsp") +region = Rect2(224, 96, 32, 32) + [sub_resource type="SpriteFrames" id="SpriteFrames_vgqql"] animations = [{ "frames": [{ "duration": 1.0, +"texture": SubResource("AtlasTexture_sbwqj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xwi16") +}], +"loop": true, +"name": &"crouching", +"speed": 2.0 +}, { +"frames": [{ +"duration": 1.0, "texture": SubResource("AtlasTexture_6t5aa") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cvnsp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vgqql") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fkybt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_x3wgy") +}], +"loop": true, +"name": &"idle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_sweqm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ph33w") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7ldla") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_r7t2e") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nmr2m") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ax3m3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3vlem") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8eeqe") +}], +"loop": false, +"name": &"rolling", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_3smsa") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8erm5") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_f1ek2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tx1dd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gymyn") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_pu2lt") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ukyrk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_7dp3o") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_h4iuc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fd4e3") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qqcod") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_igrcy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fs7ks") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_l6n3p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_olqyp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wpjfl") +}], +"loop": true, +"name": &"running", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_bi64h") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2ijsl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_p1odr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_0gysh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vfarp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y6uwr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_83xs0") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ypfnu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xuaoq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_wohnl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_36dho") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_yh6i2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nv4vc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8gxox") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_11gg7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qpa8y") }], "loop": true, -"name": &"default", +"name": &"walking", "speed": 5.0 }] @@ -26,6 +368,9 @@ script = ExtResource("1_v0iea") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=2099894889] sprite_frames = SubResource("SpriteFrames_vgqql") +animation = &"crouching" +frame = 1 +frame_progress = 0.95016706 [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1262655030] position = Vector2(-0.5, 3) diff --git a/Scripts/player.gd b/Scripts/player.gd index f89fa30..5ae0bd0 100644 --- a/Scripts/player.gd +++ b/Scripts/player.gd @@ -1,5 +1,6 @@ extends CharacterBody2D +# Exported variables to allow editing in inspector @export var speed: float = 150 @export var accelleration: int = 10 @export var jump_speed: float = -speed * 5/3 @@ -9,18 +10,24 @@ extends CharacterBody2D @export var sprint: float = 1.5 @export var sneak_speed: float = speed * 2/3 @export var crouch: bool = false -@export var is_rolling: bool = false @export var slide_speed: float = gravity/3 @export var roll_speed: float = speed+100 + +# Reference nodes @onready var animations: AnimatedSprite2D = $AnimatedSprite2D @onready var jump_buffer_timer: Timer = $jump_buffer_timer @onready var coyote_timer: Timer = $coyote_timer - +# other local variables +var is_rolling: bool = false enum State{IDLE, WALK, JUMP, DOWN, CROUCH, SNEAK, ROLL, SPRINT, SLIDE} var current_state: State = State.IDLE + func _physics_process(delta: float) -> void: + """ + Physics process function that runs at 60 fps for physics related calculations + """ handle_input() update_animation() move_and_slide() @@ -32,6 +39,7 @@ func handle_input() -> void: if Input.is_action_just_pressed("jump") and not is_on_wall_only() and crouch == false: jump_buffer_timer.start() + # sets direction var [-1,0,1] for left, none, and right respectively var direction = Input.get_axis("move_left", "move_right") if direction == 0: diff --git a/project.godot b/project.godot index 9f559ed..362d62e 100644 --- a/project.godot +++ b/project.godot @@ -52,4 +52,5 @@ crouch={ [rendering] +textures/canvas_textures/default_texture_filter=0 rendering_device/driver.windows="d3d12"