diff --git a/assets/graphics/environment/terrain/Terrain (32x32).png b/assets/graphics/environment/terrain/Terrain (32x32).png new file mode 100644 index 0000000..ddf1eaf Binary files /dev/null and b/assets/graphics/environment/terrain/Terrain (32x32).png differ diff --git a/assets/graphics/environment/terrain/Terrain (32x32).png.import b/assets/graphics/environment/terrain/Terrain (32x32).png.import new file mode 100644 index 0000000..323c2ce --- /dev/null +++ b/assets/graphics/environment/terrain/Terrain (32x32).png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bsaouyyno4ua" +path="res://.godot/imported/Terrain (32x32).png-81a713b69add642b2640197ae95d1555.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/terrain/Terrain (32x32).png" +dest_files=["res://.godot/imported/Terrain (32x32).png-81a713b69add642b2640197ae95d1555.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/assets/graphics/objects/crate (1).png b/assets/graphics/objects/crate (1).png new file mode 100644 index 0000000..2b8bdcd Binary files /dev/null and b/assets/graphics/objects/crate (1).png differ diff --git a/assets/graphics/objects/crate (1).png.import b/assets/graphics/objects/crate (1).png.import new file mode 100644 index 0000000..1f5e4be --- /dev/null +++ b/assets/graphics/objects/crate (1).png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6n4mj3l4oqlt" +path="res://.godot/imported/crate (1).png-5f4351e848f9118c4e679c70ad9284b0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/objects/crate (1).png" +dest_files=["res://.godot/imported/crate (1).png-5f4351e848f9118c4e679c70ad9284b0.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/assets/graphics/player/idle/Player Idle 48x48 (1).png b/assets/graphics/player/idle/Player Idle 48x48 (1).png new file mode 100644 index 0000000..b618511 Binary files /dev/null and b/assets/graphics/player/idle/Player Idle 48x48 (1).png differ diff --git a/assets/graphics/player/idle/Player Idle 48x48 (1).png.import b/assets/graphics/player/idle/Player Idle 48x48 (1).png.import new file mode 100644 index 0000000..2ff591f --- /dev/null +++ b/assets/graphics/player/idle/Player Idle 48x48 (1).png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://vr36ruu3ew70" +path="res://.godot/imported/Player Idle 48x48 (1).png-4a5b40070f8459bc3ad06905bee7b109.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/player/idle/Player Idle 48x48 (1).png" +dest_files=["res://.godot/imported/Player Idle 48x48 (1).png-4a5b40070f8459bc3ad06905bee7b109.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/assets/graphics/player/jumpandfall/player jump 48x48.png b/assets/graphics/player/jumpandfall/player jump 48x48.png new file mode 100644 index 0000000..dff105c Binary files /dev/null and b/assets/graphics/player/jumpandfall/player jump 48x48.png differ diff --git a/assets/graphics/player/jumpandfall/player jump 48x48.png.import b/assets/graphics/player/jumpandfall/player jump 48x48.png.import new file mode 100644 index 0000000..8addd6e --- /dev/null +++ b/assets/graphics/player/jumpandfall/player jump 48x48.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dr8leuj7yjpmo" +path="res://.godot/imported/player jump 48x48.png-edea6600ba0b9bf536bde1d00983fd16.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/player/jumpandfall/player jump 48x48.png" +dest_files=["res://.godot/imported/player jump 48x48.png-edea6600ba0b9bf536bde1d00983fd16.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/assets/graphics/player/run/player run 48x48.png b/assets/graphics/player/run/player run 48x48.png new file mode 100644 index 0000000..aca5b55 Binary files /dev/null and b/assets/graphics/player/run/player run 48x48.png differ diff --git a/assets/graphics/player/run/player run 48x48.png.import b/assets/graphics/player/run/player run 48x48.png.import new file mode 100644 index 0000000..dedea43 --- /dev/null +++ b/assets/graphics/player/run/player run 48x48.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://gat5giebysdj" +path="res://.godot/imported/player run 48x48.png-6d66612d48bfa4c8721495ba557ab7c6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/player/run/player run 48x48.png" +dest_files=["res://.godot/imported/player run 48x48.png-6d66612d48bfa4c8721495ba557ab7c6.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/assets/graphics/player/shove/Player Punch 64x64.png b/assets/graphics/player/shove/Player Punch 64x64.png new file mode 100644 index 0000000..c9a4660 Binary files /dev/null and b/assets/graphics/player/shove/Player Punch 64x64.png differ diff --git a/assets/graphics/player/shove/Player Punch 64x64.png.import b/assets/graphics/player/shove/Player Punch 64x64.png.import new file mode 100644 index 0000000..4d8388a --- /dev/null +++ b/assets/graphics/player/shove/Player Punch 64x64.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://csmss00eyd21r" +path="res://.godot/imported/Player Punch 64x64.png-e42127c3286f806d366b880ff4e58ed8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/player/shove/Player Punch 64x64.png" +dest_files=["res://.godot/imported/Player Punch 64x64.png-e42127c3286f806d366b880ff4e58ed8.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/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png b/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png new file mode 100644 index 0000000..69de991 Binary files /dev/null and b/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png differ diff --git a/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png.import b/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png.import new file mode 100644 index 0000000..d71c71d --- /dev/null +++ b/assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://m3usnluuexas" +path="res://.godot/imported/Screenshot from 2025-10-20 20-34-37.png-aa4b21e34caa204a3c782a86efe65989.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png" +dest_files=["res://.godot/imported/Screenshot from 2025-10-20 20-34-37.png-aa4b21e34caa204a3c782a86efe65989.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/assets/graphics/projectiles/pixel_bullet (1).png b/assets/graphics/projectiles/pixel_bullet (1).png new file mode 100644 index 0000000..900d030 Binary files /dev/null and b/assets/graphics/projectiles/pixel_bullet (1).png differ diff --git a/assets/graphics/projectiles/pixel_bullet (1).png.import b/assets/graphics/projectiles/pixel_bullet (1).png.import new file mode 100644 index 0000000..ac5a4d7 --- /dev/null +++ b/assets/graphics/projectiles/pixel_bullet (1).png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://db8y73is6w2g0" +path="res://.godot/imported/pixel_bullet (1).png-00812eaaf5a628e238220e7c5da62499.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/projectiles/pixel_bullet (1).png" +dest_files=["res://.godot/imported/pixel_bullet (1).png-00812eaaf5a628e238220e7c5da62499.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/project.godot b/project.godot index 53cf60d..f0d2789 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,14 @@ run/main_scene="uid://cy1i6ucex6m0d" config/features=PackedStringArray("4.5", "Forward Plus") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=320 +window/size/viewport_height=180 +window/size/window_width_override=960 +window/size/window_height_override=540 +window/stretch/mode="viewport" + [file_customization] folder_colors={ diff --git a/scenes/bullet.tscn b/scenes/bullet.tscn index 860cd2a..06f6384 100644 --- a/scenes/bullet.tscn +++ b/scenes/bullet.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://daa6idpu4gkat"] +[gd_scene load_steps=4 format=3 uid="uid://daa6idpu4gkat"] [ext_resource type="Script" uid="uid://ock81bqismk0" path="res://scripts/bullet.gd" id="1_mkf8s"] +[ext_resource type="Texture2D" uid="uid://db8y73is6w2g0" path="res://assets/graphics/projectiles/pixel_bullet (1).png" id="2_y25gk"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_h1aey"] size = Vector2(8, 6) @@ -11,3 +12,10 @@ script = ExtResource("1_mkf8s") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_h1aey") debug_color = Color(0.95943683, 0.18113726, 0.24279165, 0.41960785) + +[node name="BulletGraphic" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(-2, -2) +rotation = 3.1415927 +scale = Vector2(0.07614212, 0.1079566) +texture = ExtResource("2_y25gk") diff --git a/scenes/crate.tscn b/scenes/crate.tscn index fd4c780..b4f2915 100644 --- a/scenes/crate.tscn +++ b/scenes/crate.tscn @@ -1,11 +1,17 @@ -[gd_scene load_steps=2 format=3 uid="uid://qv8blu8wkqvq"] +[gd_scene load_steps=3 format=3 uid="uid://qv8blu8wkqvq"] + +[ext_resource type="Texture2D" uid="uid://6n4mj3l4oqlt" path="res://assets/graphics/objects/crate (1).png" id="1_b66cd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"] [node name="Crate" type="RigidBody2D"] -rotation = -0.522403 metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_uwrxv") debug_color = Color(0.84557056, 0.3727497, 0.1753774, 0.41960785) + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture_filter = 1 +scale = Vector2(0.08103401, 0.080175474) +texture = ExtResource("1_b66cd") diff --git a/scenes/game.tscn b/scenes/game.tscn index 70473ff..c2d30ec 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,29 +1,369 @@ -[gd_scene load_steps=11 format=3 uid="uid://cy1i6ucex6m0d"] +[gd_scene load_steps=13 format=4 uid="uid://cy1i6ucex6m0d"] [ext_resource type="Script" uid="uid://crhflh7kooolf" path="res://scripts/gamecontroller.gd" id="1_lbhrr"] [ext_resource type="PackedScene" uid="uid://qv8blu8wkqvq" path="res://scenes/crate.tscn" id="1_uwrxv"] +[ext_resource type="Texture2D" uid="uid://bsaouyyno4ua" path="res://assets/graphics/environment/terrain/Terrain (32x32).png" id="2_gee14"] [ext_resource type="Script" uid="uid://co43e72devw6g" path="res://scripts/scene_manager.gd" id="2_p57ef"] [ext_resource type="PackedScene" uid="uid://dmrrbiwqptrho" path="res://scenes/trigger.tscn" id="2_yqjtg"] [ext_resource type="PackedScene" uid="uid://b1yy0sybg66hh" path="res://scenes/player.tscn" id="3_lnu2h"] -[ext_resource type="PackedScene" uid="uid://daa6idpu4gkat" path="res://scenes/bullet.tscn" id="5_iywne"] -[ext_resource type="PackedScene" uid="uid://b5n0lwes8qpu5" path="res://scenes/grenade.tscn" id="7_u5sy4"] + +[sub_resource type="TileMapPattern" id="TileMapPattern_p57ef"] +tile_data = PackedInt32Array(0, 0, 0, 65536, 0, 1, 131072, 0, 2, 1, 65536, 0, 65537, 393216, 0, 131073, 65536, 2, 2, 65536, 0, 65538, 393216, 0, 131074, 65536, 2, 3, 65536, 0, 65539, 393216, 0, 131075, 65536, 2, 4, 131072, 0, 65540, 131072, 1, 131076, 131072, 2) + +[sub_resource type="TileMapPattern" id="TileMapPattern_u5sy4"] +tile_data = PackedInt32Array(0, 983040, 3, 65536, 262144, 2, 1, 131072, 4) + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_0tnpc"] +texture = ExtResource("2_gee14") +texture_region_size = Vector2i(32, 32) +0:0/0 = 0 +0:0/0/terrain_set = 0 +0:0/0/terrain = 0 +0:0/0/terrains_peering_bit/right_side = 0 +0:0/0/terrains_peering_bit/bottom_right_corner = 0 +0:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0 = 0 +1:0/0/terrain_set = 0 +1:0/0/terrain = 0 +1:0/0/terrains_peering_bit/right_side = 0 +1:0/0/terrains_peering_bit/bottom_right_corner = 0 +1:0/0/terrains_peering_bit/bottom_side = 0 +1:0/0/terrains_peering_bit/bottom_left_corner = 0 +1:0/0/terrains_peering_bit/left_side = 0 +2:0/0 = 0 +2:0/0/terrain_set = 0 +2:0/0/terrain = 0 +2:0/0/terrains_peering_bit/bottom_side = 0 +2:0/0/terrains_peering_bit/bottom_left_corner = 0 +2:0/0/terrains_peering_bit/left_side = 0 +4:0/0 = 0 +4:0/0/terrain_set = 0 +4:0/0/terrain = 0 +4:0/0/terrains_peering_bit/bottom_side = 0 +6:0/0 = 0 +6:0/0/terrain_set = 0 +6:0/0/terrain = 0 +6:0/0/terrains_peering_bit/right_side = 0 +6:0/0/terrains_peering_bit/bottom_side = 0 +6:0/0/terrains_peering_bit/bottom_left_corner = 0 +6:0/0/terrains_peering_bit/left_side = 0 +6:0/0/terrains_peering_bit/top_left_corner = 0 +6:0/0/terrains_peering_bit/top_side = 0 +6:0/0/terrains_peering_bit/top_right_corner = 0 +7:0/0 = 0 +7:0/0/terrain_set = 0 +7:0/0/terrain = 0 +7:0/0/terrains_peering_bit/right_side = 0 +7:0/0/terrains_peering_bit/bottom_right_corner = 0 +7:0/0/terrains_peering_bit/bottom_side = 0 +7:0/0/terrains_peering_bit/left_side = 0 +7:0/0/terrains_peering_bit/top_left_corner = 0 +7:0/0/terrains_peering_bit/top_side = 0 +7:0/0/terrains_peering_bit/top_right_corner = 0 +9:0/0 = 0 +9:0/0/terrain_set = 0 +9:0/0/terrain = 0 +9:0/0/terrains_peering_bit/right_side = 0 +9:0/0/terrains_peering_bit/bottom_right_corner = 0 +9:0/0/terrains_peering_bit/bottom_side = 0 +9:0/0/terrains_peering_bit/bottom_left_corner = 0 +9:0/0/terrains_peering_bit/left_side = 0 +9:0/0/terrains_peering_bit/top_side = 0 +10:0/0 = 0 +10:0/0/terrain_set = 0 +10:0/0/terrain = 0 +10:0/0/terrains_peering_bit/right_side = 0 +10:0/0/terrains_peering_bit/bottom_side = 0 +10:0/0/terrains_peering_bit/bottom_left_corner = 0 +10:0/0/terrains_peering_bit/left_side = 0 +10:0/0/terrains_peering_bit/top_left_corner = 0 +10:0/0/terrains_peering_bit/top_side = 0 +12:0/0 = 0 +12:0/0/terrain_set = 0 +12:0/0/terrain = 0 +12:0/0/terrains_peering_bit/right_side = 0 +12:0/0/terrains_peering_bit/bottom_right_corner = 0 +12:0/0/terrains_peering_bit/bottom_side = 0 +12:0/0/terrains_peering_bit/left_side = 0 +12:0/0/terrains_peering_bit/top_side = 0 +13:0/0 = 0 +13:0/0/terrain_set = 0 +13:0/0/terrain = 0 +13:0/0/terrains_peering_bit/right_side = 0 +13:0/0/terrains_peering_bit/bottom_side = 0 +13:0/0/terrains_peering_bit/bottom_left_corner = 0 +13:0/0/terrains_peering_bit/left_side = 0 +13:0/0/terrains_peering_bit/top_side = 0 +15:0/0 = 0 +15:0/0/terrain_set = 0 +15:0/0/terrain = 0 +15:0/0/terrains_peering_bit/right_side = 0 +15:0/0/terrains_peering_bit/bottom_side = 0 +15:0/0/terrains_peering_bit/left_side = 0 +15:0/0/terrains_peering_bit/top_side = 0 +0:1/0 = 0 +0:1/0/terrain_set = 0 +0:1/0/terrain = 0 +0:1/0/terrains_peering_bit/right_side = 0 +0:1/0/terrains_peering_bit/bottom_right_corner = 0 +0:1/0/terrains_peering_bit/bottom_side = 0 +0:1/0/terrains_peering_bit/top_side = 0 +0:1/0/terrains_peering_bit/top_right_corner = 0 +1:1/0 = 0 +2:1/0 = 0 +2:1/0/terrain_set = 0 +2:1/0/terrain = 0 +2:1/0/terrains_peering_bit/bottom_side = 0 +2:1/0/terrains_peering_bit/bottom_left_corner = 0 +2:1/0/terrains_peering_bit/left_side = 0 +2:1/0/terrains_peering_bit/top_left_corner = 0 +2:1/0/terrains_peering_bit/top_side = 0 +4:1/0 = 0 +4:1/0/terrain_set = 0 +4:1/0/terrain = 0 +4:1/0/terrains_peering_bit/bottom_side = 0 +4:1/0/terrains_peering_bit/top_side = 0 +6:1/0 = 0 +6:1/0/terrain_set = 0 +6:1/0/terrain = 0 +6:1/0/terrains_peering_bit/right_side = 0 +6:1/0/terrains_peering_bit/bottom_right_corner = 0 +6:1/0/terrains_peering_bit/bottom_side = 0 +6:1/0/terrains_peering_bit/bottom_left_corner = 0 +6:1/0/terrains_peering_bit/left_side = 0 +6:1/0/terrains_peering_bit/top_left_corner = 0 +6:1/0/terrains_peering_bit/top_side = 0 +7:1/0 = 0 +7:1/0/terrain_set = 0 +7:1/0/terrain = 0 +7:1/0/terrains_peering_bit/right_side = 0 +7:1/0/terrains_peering_bit/bottom_right_corner = 0 +7:1/0/terrains_peering_bit/bottom_side = 0 +7:1/0/terrains_peering_bit/bottom_left_corner = 0 +7:1/0/terrains_peering_bit/left_side = 0 +7:1/0/terrains_peering_bit/top_side = 0 +7:1/0/terrains_peering_bit/top_right_corner = 0 +9:1/0 = 0 +9:1/0/terrain_set = 0 +9:1/0/terrain = 0 +9:1/0/terrains_peering_bit/right_side = 0 +9:1/0/terrains_peering_bit/bottom_right_corner = 0 +9:1/0/terrains_peering_bit/bottom_side = 0 +9:1/0/terrains_peering_bit/left_side = 0 +9:1/0/terrains_peering_bit/top_side = 0 +9:1/0/terrains_peering_bit/top_right_corner = 0 +10:1/0 = 0 +10:1/0/terrain_set = 0 +10:1/0/terrain = 0 +10:1/0/terrains_peering_bit/right_side = 0 +10:1/0/terrains_peering_bit/bottom_side = 0 +10:1/0/terrains_peering_bit/left_side = 0 +10:1/0/terrains_peering_bit/top_left_corner = 0 +10:1/0/terrains_peering_bit/top_side = 0 +10:1/0/terrains_peering_bit/top_right_corner = 0 +12:1/0 = 0 +12:1/0/terrain_set = 0 +12:1/0/terrain = 0 +12:1/0/terrains_peering_bit/right_side = 0 +12:1/0/terrains_peering_bit/bottom_side = 0 +12:1/0/terrains_peering_bit/left_side = 0 +12:1/0/terrains_peering_bit/top_side = 0 +12:1/0/terrains_peering_bit/top_right_corner = 0 +13:1/0 = 0 +13:1/0/terrain_set = 0 +13:1/0/terrain = 0 +13:1/0/terrains_peering_bit/right_side = 0 +13:1/0/terrains_peering_bit/bottom_side = 0 +13:1/0/terrains_peering_bit/left_side = 0 +13:1/0/terrains_peering_bit/top_left_corner = 0 +13:1/0/terrains_peering_bit/top_side = 0 +15:1/0 = 0 +15:1/0/terrain_set = 0 +15:1/0/terrain = 0 +15:1/0/terrains_peering_bit/right_side = 0 +15:1/0/terrains_peering_bit/bottom_side = 0 +15:1/0/terrains_peering_bit/bottom_left_corner = 0 +15:1/0/terrains_peering_bit/left_side = 0 +15:1/0/terrains_peering_bit/top_side = 0 +15:1/0/terrains_peering_bit/top_right_corner = 0 +16:1/0 = 0 +16:1/0/terrain_set = 0 +16:1/0/terrain = 0 +16:1/0/terrains_peering_bit/right_side = 0 +16:1/0/terrains_peering_bit/bottom_right_corner = 0 +16:1/0/terrains_peering_bit/bottom_side = 0 +16:1/0/terrains_peering_bit/left_side = 0 +16:1/0/terrains_peering_bit/top_left_corner = 0 +16:1/0/terrains_peering_bit/top_side = 0 +0:2/0 = 0 +0:2/0/terrain_set = 0 +0:2/0/terrain = 0 +0:2/0/terrains_peering_bit/right_side = 0 +0:2/0/terrains_peering_bit/top_side = 0 +0:2/0/terrains_peering_bit/top_right_corner = 0 +1:2/0 = 0 +1:2/0/terrain_set = 0 +1:2/0/terrain = 0 +1:2/0/terrains_peering_bit/right_side = 0 +1:2/0/terrains_peering_bit/left_side = 0 +1:2/0/terrains_peering_bit/top_left_corner = 0 +1:2/0/terrains_peering_bit/top_side = 0 +1:2/0/terrains_peering_bit/top_right_corner = 0 +2:2/0 = 0 +2:2/0/terrain_set = 0 +2:2/0/terrain = 0 +2:2/0/terrains_peering_bit/left_side = 0 +2:2/0/terrains_peering_bit/top_left_corner = 0 +2:2/0/terrains_peering_bit/top_side = 0 +4:2/0 = 0 +4:2/0/terrain_set = 0 +4:2/0/terrain = 0 +4:2/0/terrains_peering_bit/top_side = 0 +6:3/0 = 0 +6:3/0/terrain_set = 0 +6:3/0/terrain = 0 +6:3/0/terrains_peering_bit/right_side = 0 +6:3/0/terrains_peering_bit/bottom_side = 0 +6:3/0/terrains_peering_bit/top_side = 0 +6:3/0/terrains_peering_bit/top_right_corner = 0 +7:3/0 = 0 +7:3/0/terrain_set = 0 +7:3/0/terrain = 0 +7:3/0/terrains_peering_bit/bottom_side = 0 +7:3/0/terrains_peering_bit/left_side = 0 +7:3/0/terrains_peering_bit/top_left_corner = 0 +7:3/0/terrains_peering_bit/top_side = 0 +9:3/0 = 0 +9:3/0/terrain_set = 0 +9:3/0/terrain = 0 +9:3/0/terrains_peering_bit/right_side = 0 +9:3/0/terrains_peering_bit/bottom_side = 0 +9:3/0/terrains_peering_bit/bottom_left_corner = 0 +9:3/0/terrains_peering_bit/left_side = 0 +10:3/0 = 0 +10:3/0/terrain_set = 0 +10:3/0/terrain = 0 +10:3/0/terrains_peering_bit/right_side = 0 +10:3/0/terrains_peering_bit/bottom_right_corner = 0 +10:3/0/terrains_peering_bit/bottom_side = 0 +10:3/0/terrains_peering_bit/left_side = 0 +12:3/0 = 0 +12:3/0/terrain_set = 0 +12:3/0/terrain = 0 +12:3/0/terrains_peering_bit/right_side = 0 +12:3/0/terrains_peering_bit/bottom_side = 0 +12:3/0/terrains_peering_bit/top_side = 0 +13:3/0 = 0 +13:3/0/terrain_set = 0 +13:3/0/terrain = 0 +13:3/0/terrains_peering_bit/right_side = 0 +13:3/0/terrains_peering_bit/bottom_side = 0 +13:3/0/terrains_peering_bit/left_side = 0 +15:3/0 = 0 +15:3/0/terrain_set = 0 +15:3/0/terrain = 0 +15:3/0/terrains_peering_bit/right_side = 0 +15:3/0/terrains_peering_bit/bottom_side = 0 +16:3/0 = 0 +16:3/0/terrain_set = 0 +16:3/0/terrain = 0 +16:3/0/terrains_peering_bit/bottom_side = 0 +16:3/0/terrains_peering_bit/left_side = 0 +0:4/0 = 0 +0:4/0/terrain_set = 0 +0:4/0/terrain = 0 +0:4/0/terrains_peering_bit/right_side = 0 +1:4/0 = 0 +1:4/0/terrain_set = 0 +1:4/0/terrain = 0 +1:4/0/terrains_peering_bit/right_side = 0 +1:4/0/terrains_peering_bit/left_side = 0 +2:4/0 = 0 +2:4/0/terrain_set = 0 +2:4/0/terrain = 0 +2:4/0/terrains_peering_bit/left_side = 0 +4:4/0 = 0 +4:4/0/terrain_set = 0 +4:4/0/terrain = 0 +6:4/0 = 0 +6:4/0/terrain_set = 0 +6:4/0/terrain = 0 +6:4/0/terrains_peering_bit/right_side = 0 +6:4/0/terrains_peering_bit/bottom_right_corner = 0 +6:4/0/terrains_peering_bit/bottom_side = 0 +6:4/0/terrains_peering_bit/top_side = 0 +7:4/0 = 0 +7:4/0/terrain_set = 0 +7:4/0/terrain = 0 +7:4/0/terrains_peering_bit/bottom_side = 0 +7:4/0/terrains_peering_bit/bottom_left_corner = 0 +7:4/0/terrains_peering_bit/left_side = 0 +7:4/0/terrains_peering_bit/top_side = 0 +9:4/0 = 0 +9:4/0/terrain_set = 0 +9:4/0/terrain = 0 +9:4/0/terrains_peering_bit/right_side = 0 +9:4/0/terrains_peering_bit/left_side = 0 +9:4/0/terrains_peering_bit/top_left_corner = 0 +9:4/0/terrains_peering_bit/top_side = 0 +10:4/0 = 0 +10:4/0/terrain_set = 0 +10:4/0/terrain = 0 +10:4/0/terrains_peering_bit/right_side = 0 +10:4/0/terrains_peering_bit/left_side = 0 +10:4/0/terrains_peering_bit/top_side = 0 +10:4/0/terrains_peering_bit/top_right_corner = 0 +12:4/0 = 0 +12:4/0/terrain_set = 0 +12:4/0/terrain = 0 +12:4/0/terrains_peering_bit/right_side = 0 +12:4/0/terrains_peering_bit/left_side = 0 +12:4/0/terrains_peering_bit/top_side = 0 +13:4/0 = 0 +13:4/0/terrain_set = 0 +13:4/0/terrain = 0 +13:4/0/terrains_peering_bit/bottom_side = 0 +13:4/0/terrains_peering_bit/left_side = 0 +13:4/0/terrains_peering_bit/top_side = 0 +15:4/0 = 0 +15:4/0/terrain_set = 0 +15:4/0/terrain = 0 +15:4/0/terrains_peering_bit/right_side = 0 +15:4/0/terrains_peering_bit/top_side = 0 +16:4/0 = 0 +16:4/0/terrain_set = 0 +16:4/0/terrain = 0 +16:4/0/terrains_peering_bit/left_side = 0 +16:4/0/terrains_peering_bit/top_side = 0 + +[sub_resource type="TileSet" id="TileSet_vtaks"] +tile_size = Vector2i(32, 32) +terrain_set_0/mode = 0 +terrain_set_0/terrain_0/name = "LeafyDirt" +terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1) +sources/0 = SubResource("TileSetAtlasSource_0tnpc") +pattern_0 = SubResource("TileMapPattern_p57ef") +pattern_1 = SubResource("TileMapPattern_u5sy4") [sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"] size = Vector2(68, 35) -[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"] - [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"] [node name="Game" type="Node2D"] +scale = Vector2(0.9976793, 0.99848104) script = ExtResource("1_lbhrr") +[node name="TileMapLayer" type="TileMapLayer" parent="."] +tile_map_data = PackedByteArray("AAAMAAsAAAABAAQAAAALAAsAAAAAAAQAAAANAAsAAAACAAQAAAAJAA0AAAAAAAQAAAAKAA0AAAACAAQAAAAKABEAAAAAAAQAAAALABEAAAABAAQAAAAMABEAAAABAAQAAAANABEAAAABAAQAAAAOABEAAAABAAQAAAAPABEAAAABAAQAAAAQABEAAAABAAQAAAARABEAAAACAAQAAAAVABEAAAAEAAQAAAAUABEAAAAEAAQAAAARAA8AAAAEAAIAAAARAA4AAAAPAAMAAAASAA4AAAACAAQAAAAWAA4AAAAEAAIAAAAWAA0AAAAPAAMAAAAXAA0AAAAKAAQAAAAXAAwAAAAAAAAAAAAYAAwAAAABAAAAAAAZAAwAAAAHAAEAAAAZAAsAAAAGAAQAAAAZAAoAAAAEAAAAAAAaAAsAAAABAAAAAAAbAAsAAAAHAAEAAAAcAAsAAAACAAEAAAAcAAoAAAACAAAAAAAbAAoAAAAAAAAAAAAaAAwAAAAGAAAAAAAbAAwAAAAGAAAAAAAcAAwAAAACAAIAAAAbAA0AAAACAAIAAAAaAA0AAAAGAAAAAAAZAA0AAAAGAAAAAAAaAA4AAAACAAIAAAAZAA4AAAABAAIAAAAYAA4AAAAAAAIAAAAYAA0AAAAHAAAAAAAFABAAAAABAAQAAAAFABIAAAABAAQAAAAGABAAAAABAAQAAAAGABIAAAABAAQAAAAHABAAAAABAAQAAAAHABIAAAABAAQAAAAIABAAAAABAAQAAAAIABIAAAABAAQAAAAJABAAAAAQAAMAAAAJABEAAAAEAAEAAAAJABIAAAAQAAQAAAAAAAoAAAAAAAAAAAAAAAsAAAAAAAEAAAAAAAwAAAAAAAIAAAABAAoAAAABAAAAAAABAAsAAAAGAAAAAAABAAwAAAABAAIAAAACAAoAAAABAAAAAAACAAsAAAAGAAAAAAACAAwAAAABAAIAAAADAAoAAAABAAAAAAADAAsAAAAGAAAAAAADAAwAAAABAAIAAAAEAAoAAAACAAAAAAAEAAsAAAACAAEAAAAEAAwAAAACAAIAAAAXABEAAAAAAAAAAAAXABIAAAAAAAEAAAAXABMAAAAAAAIAAAAYABEAAAABAAAAAAAYABIAAAAGAAAAAAAYABMAAAABAAIAAAAZABEAAAABAAAAAAAZABIAAAAGAAAAAAAZABMAAAABAAIAAAAaABEAAAABAAAAAAAaABIAAAAGAAAAAAAaABMAAAABAAIAAAAbABEAAAACAAAAAAAbABIAAAACAAEAAAAbABMAAAACAAIAAAACABAAAAAAAAAAAAACABEAAAAAAAEAAAACABIAAAAAAAIAAAADABAAAAABAAAAAAADABEAAAAGAAAAAAADABIAAAABAAIAAAAEABAAAAAJAAMAAAAEABEAAAACAAEAAAAEABIAAAAJAAQAAAD//wcAAAAPAAMAAAD//wgAAAAEAAIAAAAAAAcAAAACAAQAAAA=") +tile_set = SubResource("TileSet_vtaks") + [node name="SceneManager" type="Node2D" parent="."] unique_name_in_owner = true script = ExtResource("2_p57ef") [node name="StaticBody2D" type="StaticBody2D" parent="."] -position = Vector2(394, 353) +position = Vector2(399, 363) metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] @@ -31,7 +371,7 @@ position = Vector2(0, 7.5) shape = SubResource("RectangleShape2D_8cj0n") [node name="StaticBody2D2" type="StaticBody2D" parent="."] -position = Vector2(312, 412) +position = Vector2(320.74435, 426.64807) metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"] @@ -48,25 +388,15 @@ position = Vector2(0, 7.5) shape = SubResource("RectangleShape2D_8cj0n") [node name="Crate" parent="." groups=["pushable", "splodable"] instance=ExtResource("1_uwrxv")] -position = Vector2(406.00003, 327) +position = Vector2(353.8211, 281.4275) -[node name="RigidBody2D2" type="RigidBody2D" parent="." groups=["pushable", "splodable"]] -position = Vector2(243, 371) -rotation = -1.099222 -metadata/_edit_group_ = true +[node name="Crate2" parent="." groups=["pushable", "splodable"] instance=ExtResource("1_uwrxv")] +position = Vector2(445.03278, 293.44574) +rotation = -0.7766715 -[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D2"] -shape = SubResource("RectangleShape2D_uwrxv") -debug_color = Color(0.84557056, 0.3727497, 0.1753774, 0.41960785) - -[node name="RigidBody2D3" type="RigidBody2D" parent="." groups=["pushable", "splodable"]] -position = Vector2(502, 230) -rotation = -1.099222 -metadata/_edit_group_ = true - -[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D3"] -shape = SubResource("RectangleShape2D_uwrxv") -debug_color = Color(0.84557056, 0.3727497, 0.1753774, 0.41960785) +[node name="Crate3" parent="." groups=["pushable", "splodable"] instance=ExtResource("1_uwrxv")] +position = Vector2(254.5908, 285.43356) +rotation = 0.51836276 [node name="Boundary" type="StaticBody2D" parent="."] position = Vector2(389, 542) @@ -76,21 +406,15 @@ metadata/_edit_group_ = true shape = SubResource("WorldBoundaryShape2D_8cj0n") [node name="Trigger" parent="." instance=ExtResource("2_yqjtg")] -position = Vector2(434, 409) +position = Vector2(648, 382.99997) [node name="Trigger2" parent="." instance=ExtResource("2_yqjtg")] position = Vector2(255.00002, 460.99997) intent = "powerup" [node name="CharacterBody2D" parent="." instance=ExtResource("3_lnu2h")] -position = Vector2(379, 331) +position = Vector2(401.93277, 341.51877) BUMP_POWER = 50 -[node name="Bullet" parent="." instance=ExtResource("5_iywne")] -position = Vector2(293, 329) - -[node name="Grenade" parent="." instance=ExtResource("7_u5sy4")] -position = Vector2(380, 307) - [connection signal="triggerFiredSignal" from="Trigger" to="." method="_on_trigger_fired"] [connection signal="triggerFiredSignal" from="Trigger2" to="." method="_on_trigger_fired"] diff --git a/scenes/grenade.tscn b/scenes/grenade.tscn index a6989f1..27ee334 100644 --- a/scenes/grenade.tscn +++ b/scenes/grenade.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://b5n0lwes8qpu5"] +[gd_scene load_steps=4 format=3 uid="uid://b5n0lwes8qpu5"] [ext_resource type="Script" uid="uid://cev3cg5mdn3it" path="res://scripts/grenade.gd" id="1_cvyik"] +[ext_resource type="Texture2D" uid="uid://m3usnluuexas" path="res://assets/graphics/projectiles/Screenshot from 2025-10-20 20-34-37.png" id="2_wxtds"] [sub_resource type="CircleShape2D" id="CircleShape2D_1xt3t"] radius = 3.0 @@ -14,4 +15,9 @@ script = ExtResource("1_cvyik") shape = SubResource("CircleShape2D_1xt3t") debug_color = Color(0.6279718, 0.5294392, 0.11152003, 0.41960785) +[node name="Sprite2D" type="Sprite2D" parent="."] +texture_filter = 1 +scale = Vector2(0.017808493, 0.016220678) +texture = ExtResource("2_wxtds") + [connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/player.tscn b/scenes/player.tscn index 20452ae..8770a70 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -1,9 +1,209 @@ -[gd_scene load_steps=3 format=3 uid="uid://b1yy0sybg66hh"] +[gd_scene load_steps=32 format=3 uid="uid://b1yy0sybg66hh"] [ext_resource type="Script" uid="uid://kv8w1gwuy3il" path="res://scripts/player.gd" id="1_3vyb7"] +[ext_resource type="Texture2D" uid="uid://vr36ruu3ew70" path="res://assets/graphics/player/idle/Player Idle 48x48 (1).png" id="2_g2els"] +[ext_resource type="Texture2D" uid="uid://dr8leuj7yjpmo" path="res://assets/graphics/player/jumpandfall/player jump 48x48.png" id="2_qhqgy"] +[ext_resource type="Texture2D" uid="uid://gat5giebysdj" path="res://assets/graphics/player/run/player run 48x48.png" id="4_dqkch"] +[ext_resource type="Texture2D" uid="uid://csmss00eyd21r" path="res://assets/graphics/player/shove/Player Punch 64x64.png" id="5_qlg0r"] [sub_resource type="CircleShape2D" id="CircleShape2D_3vyb7"] +[sub_resource type="AtlasTexture" id="AtlasTexture_jej6c"] +atlas = ExtResource("2_qhqgy") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"] +atlas = ExtResource("2_g2els") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dqkch"] +atlas = ExtResource("2_g2els") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qlg0r"] +atlas = ExtResource("2_g2els") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tuyoq"] +atlas = ExtResource("2_g2els") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fjrip"] +atlas = ExtResource("2_g2els") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_smehm"] +atlas = ExtResource("2_g2els") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ur7pv"] +atlas = ExtResource("2_g2els") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y4r1p"] +atlas = ExtResource("2_g2els") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_d2wvv"] +atlas = ExtResource("2_g2els") +region = Rect2(384, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_3v2ag"] +atlas = ExtResource("2_g2els") +region = Rect2(432, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f1ej7"] +atlas = ExtResource("2_qhqgy") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_oprun"] +atlas = ExtResource("2_qhqgy") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a8ls1"] +atlas = ExtResource("4_dqkch") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_qfm1y"] +atlas = ExtResource("4_dqkch") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fulsm"] +atlas = ExtResource("4_dqkch") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4r5pv"] +atlas = ExtResource("4_dqkch") +region = Rect2(144, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_60mlk"] +atlas = ExtResource("4_dqkch") +region = Rect2(192, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i4ail"] +atlas = ExtResource("4_dqkch") +region = Rect2(240, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a38lo"] +atlas = ExtResource("4_dqkch") +region = Rect2(288, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4ni07"] +atlas = ExtResource("4_dqkch") +region = Rect2(336, 0, 48, 48) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l71n6"] +atlas = ExtResource("5_qlg0r") +region = Rect2(192, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ke2ow"] +atlas = ExtResource("5_qlg0r") +region = Rect2(256, 0, 64, 64) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ujl30"] +atlas = ExtResource("5_qlg0r") +region = Rect2(320, 0, 64, 64) + +[sub_resource type="SpriteFrames" id="SpriteFrames_jej6c"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_jej6c") +}], +"loop": false, +"name": &"fall", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_qhqgy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dqkch") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qlg0r") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tuyoq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fjrip") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_smehm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ur7pv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_y4r1p") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_d2wvv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_3v2ag") +}], +"loop": true, +"name": &"idle", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_f1ej7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_oprun") +}], +"loop": false, +"name": &"jump", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_a8ls1") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_qfm1y") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fulsm") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4r5pv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_60mlk") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i4ail") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_a38lo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4ni07") +}], +"loop": true, +"name": &"run", +"speed": 12.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_l71n6") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ke2ow") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ujl30") +}], +"loop": false, +"name": &"shove", +"speed": 12.0 +}] + [node name="CharacterBody2D" type="CharacterBody2D"] script = ExtResource("1_3vyb7") @@ -22,3 +222,20 @@ position = Vector2(14, -8) [node name="LeftSpawn" type="Marker2D" parent="."] position = Vector2(-13, -8) + +[node name="JumpBufferTimer" type="Timer" parent="."] +one_shot = true + +[node name="PlayerGraphic" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +position = Vector2(0, -6) +sprite_frames = SubResource("SpriteFrames_jej6c") +animation = &"shove" +autoplay = "idle" +frame = 1 +frame_progress = 0.25700366 + +[node name="Camera2D" type="Camera2D" parent="."] +offset = Vector2(0, -30) + +[connection signal="animation_finished" from="PlayerGraphic" to="." method="_on_animation_finished"] diff --git a/scripts/bullet.gd b/scripts/bullet.gd index b896f6e..c530adc 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -1,6 +1,7 @@ class_name Bullet extends Area2D var speed:float = 700 +@onready var bullet_graphic = $BulletGraphic # Called when the node enters the scene tree for the first time. func _ready(): @@ -11,5 +12,9 @@ func _ready(): func _process(delta): position += transform.x * speed * delta -func setSpeed(value)->void: +func xz(value)->void: speed = value + if speed<0: + bullet_graphic.flip_h = true + else: + bullet_graphic.flip_h = false diff --git a/scripts/player.gd b/scripts/player.gd index 1c55094..d23661f 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -7,6 +7,9 @@ var direction:float = 0 @export var BUMP_POWER = 100 enum FaceDirection{LEFT, RIGHT} var facing:FaceDirection = FaceDirection.RIGHT +enum State{IDLE,JUMP,FALLING,RUNNING,SHOVE} +var current_state:State = State.IDLE + @onready var right_cast = $RightCast @onready var left_cast = $LeftCast var pushTarget:RigidBody2D @@ -14,23 +17,65 @@ var pushEnabled:bool = false @onready var right_spawn = $RightSpawn @onready var left_spawn = $LeftSpawn +@export var acceleration:int = 900 +@onready var jump_buffer_timer = $JumpBufferTimer +var upJump:bool = false + +@export var hard_gravity:float =1.5 +@onready var player_graphic = $PlayerGraphic + func _physics_process(delta): # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. handle_input() handle_movement(delta) + update_states() + update_animation() move_and_slide() handle_collisions() - + +func update_states()->void: + #Create a state machine + match current_state: + #scenarios + State.JUMP when velocity.y > 0: + current_state = State.FALLING + State.FALLING when is_on_floor(): + if velocity.x == 0: + current_state = State.IDLE + else: + current_state = State.RUNNING + State.IDLE when velocity.x !=0: + current_state = State.RUNNING + State.RUNNING when velocity.x ==0: + current_state = State.IDLE + +func update_animation()->void: + match current_state: + State.IDLE: + player_graphic.play("idle") + State.JUMP: + if upJump: + player_graphic.play("jump") + State.FALLING: + player_graphic.play("fall") + State.RUNNING: + player_graphic.play("run") + State.SHOVE: + player_graphic.play("shove") + func handle_input()->void: # Handle jump. if Input.is_action_just_pressed("jump") and is_on_floor(): - velocity.y = JUMP_VELOCITY + #velocity.y = JUMP_VELOCITY + jump_buffer_timer.start() direction = Input.get_axis("moveLeft", "moveRight") if direction <0: facing=FaceDirection.LEFT + player_graphic.flip_h = true if direction >0: facing=FaceDirection.RIGHT + player_graphic.flip_h = false if Input.is_action_just_pressed("shove") && pushEnabled: print("I want to shove") @@ -40,7 +85,7 @@ func handle_input()->void: shoveDirection = 1 FaceDirection.LEFT: shoveDirection = -1 - + current_state = State.SHOVE pushTarget.apply_central_impulse(Vector2(shoveDirection,0)*700) if Input.is_action_just_pressed("shoot"): print("Ima shoot") @@ -60,13 +105,22 @@ func handle_input()->void: %SceneManager.makeGrenade(left_spawn.global_transform, -1) func handle_movement(_delta)->void: - if direction: - velocity.x = direction * SPEED + if direction ==0: + velocity.x = move_toward(velocity.x, 0, acceleration*_delta) else: - velocity.x = move_toward(velocity.x, 0, SPEED) + velocity.x = move_toward(velocity.x, SPEED*direction, acceleration*_delta) - if not is_on_floor(): + if current_state == State.JUMP: + #apply normal velocity velocity += get_gravity() * _delta + else: + velocity += get_gravity() * hard_gravity * _delta + + if is_on_floor() && jump_buffer_timer.time_left>0: + velocity.y = JUMP_VELOCITY + current_state = State.JUMP + upJump = true + jump_buffer_timer.stop() func handle_collisions()->void: #handle world reactions @@ -87,6 +141,14 @@ func handle_collisions()->void: if collider is Node && collider is RigidBody2D && collider.is_in_group("pushable"): pushTarget = collider pushEnabled = true - + if not right_cast.is_colliding() && not left_cast.is_colliding(): pushEnabled = false + + +func _on_animation_finished(): + match current_state: + State.JUMP: + upJump=false + State.SHOVE: + current_state = State.IDLE