camera, textures, scaling, tilemap

This commit is contained in:
Adam Burns 2026-05-11 21:03:27 -04:00
parent e80ace000d
commit 28b59ef4fe
19 changed files with 661 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cmp7cdbeppphh"
path="res://.godot/imported/Terrain (32x32).png-ea1f17749d56fb530acff47dc14e81b4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/Enviromentsf/Terrain (32x32).png"
dest_files=["res://.godot/imported/Terrain (32x32).png-ea1f17749d56fb530acff47dc14e81b4.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgd6djkjrq6g0"
path="res://.godot/imported/bomb.png-e0eaffdb050286147f1cd502b0cb6a8c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/objects/bomb.png"
dest_files=["res://.godot/imported/bomb.png-e0eaffdb050286147f1cd502b0cb6a8c.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ckfmdpaijf1rh"
path="res://.godot/imported/cratetexture.png-85707279a6add08567d287efda907cb3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/objects/cratetexture.png"
dest_files=["res://.godot/imported/cratetexture.png-85707279a6add08567d287efda907cb3.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cpjqgpeoi58u7"
path="res://.godot/imported/pixil-frame-0.png-73143b3dad5786fe6239756542c3dd43.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/objects/pixil-frame-0.png"
dest_files=["res://.godot/imported/pixil-frame-0.png-73143b3dad5786fe6239756542c3dd43.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://2mmshabempai"
path="res://.godot/imported/bomb.png-7fb92c4a99cf9647cae5324a4fdf6712.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/player/bomb.png"
dest_files=["res://.godot/imported/bomb.png-7fb92c4a99cf9647cae5324a4fdf6712.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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://5py2wuhb4a4u"
path="res://.godot/imported/player jump 48x48.png-3f2379396c4ee38ba6753cc20f4cda5f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/player/player jump 48x48.png"
dest_files=["res://.godot/imported/player jump 48x48.png-3f2379396c4ee38ba6753cc20f4cda5f.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

View File

@ -15,6 +15,14 @@ run/main_scene="uid://btxq5hrirovod"
config/features=PackedStringArray("4.6", "Forward Plus") config/features=PackedStringArray("4.6", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[display]
window/size/viewport_width=480
window/size/viewport_height=270
window/size/window_width_override=960
window/size/window_height_override=540
window/stretch/mode="viewport"
[file_customization] [file_customization]
folder_colors={ folder_colors={
@ -33,6 +41,11 @@ chuck={
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(227, 2),"global_position":Vector2(236, 50),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(227, 2),"global_position":Vector2(236, 50),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
] ]
} }
jump={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
[physics] [physics]

View File

@ -1,11 +1,16 @@
[gd_scene format=3 uid="uid://d4nnj62h6fjcq"] [gd_scene format=3 uid="uid://d4nnj62h6fjcq"]
[ext_resource type="Script" uid="uid://f42eg5a0cckl" path="res://scripts/player_guy.gd" id="1_j5628"] [ext_resource type="Script" uid="uid://f42eg5a0cckl" path="res://scripts/player_guy.gd" id="1_j5628"]
[ext_resource type="Texture2D" uid="uid://5py2wuhb4a4u" path="res://assets/graphics/player/player jump 48x48.png" id="2_86iwx"]
[ext_resource type="Texture2D" uid="uid://p72rbg7thsvi" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_qug0s"] [ext_resource type="Texture2D" uid="uid://p72rbg7thsvi" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_qug0s"]
[ext_resource type="Texture2D" uid="uid://b74hvan7k63nk" path="res://assets/graphics/player/run/player run 48x48.png" id="3_gd05a"] [ext_resource type="Texture2D" uid="uid://b74hvan7k63nk" path="res://assets/graphics/player/run/player run 48x48.png" id="3_gd05a"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_80nbo"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_80nbo"]
[sub_resource type="AtlasTexture" id="AtlasTexture_7uqae"]
atlas = ExtResource("2_86iwx")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_gd05a"] [sub_resource type="AtlasTexture" id="AtlasTexture_gd05a"]
atlas = ExtResource("2_qug0s") atlas = ExtResource("2_qug0s")
region = Rect2(0, 0, 48, 48) region = Rect2(0, 0, 48, 48)
@ -46,6 +51,14 @@ region = Rect2(384, 0, 48, 48)
atlas = ExtResource("2_qug0s") atlas = ExtResource("2_qug0s")
region = Rect2(432, 0, 48, 48) region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_3v645"]
atlas = ExtResource("2_86iwx")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_h055f"]
atlas = ExtResource("2_86iwx")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_mu2pl"] [sub_resource type="AtlasTexture" id="AtlasTexture_mu2pl"]
atlas = ExtResource("3_gd05a") atlas = ExtResource("3_gd05a")
region = Rect2(0, 0, 48, 48) region = Rect2(0, 0, 48, 48)
@ -82,6 +95,14 @@ region = Rect2(336, 0, 48, 48)
animations = [{ animations = [{
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_7uqae")
}],
"loop": false,
"name": &"fall",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_gd05a") "texture": SubResource("AtlasTexture_gd05a")
}, { }, {
"duration": 1.0, "duration": 1.0,
@ -117,6 +138,17 @@ animations = [{
}, { }, {
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_3v645")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h055f")
}],
"loop": false,
"name": &"jump",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mu2pl") "texture": SubResource("AtlasTexture_mu2pl")
}, { }, {
"duration": 1.0, "duration": 1.0,
@ -165,7 +197,13 @@ position = Vector2(-20, -8)
[node name="player graphic" type="AnimatedSprite2D" parent="." unique_id=1007399411] [node name="player graphic" type="AnimatedSprite2D" parent="." unique_id=1007399411]
texture_filter = 1 texture_filter = 1
position = Vector2(2, -1) position = Vector2(2, -19)
scale = Vector2(2.1458333, 2.0416667)
sprite_frames = SubResource("SpriteFrames_mu2pl") sprite_frames = SubResource("SpriteFrames_mu2pl")
animation = &"run" animation = &"idle"
autoplay = "idle" autoplay = "idle"
[node name="Camera2D" type="Camera2D" parent="." unique_id=157042894]
zoom = Vector2(0.5, 0.5)
[connection signal="animation_finished" from="player graphic" to="." method="_on_animation_finished"]

View File

@ -1,13 +1,26 @@
[gd_scene format=3 uid="uid://d0wbtenf13iol"] [gd_scene format=3 uid="uid://d0wbtenf13iol"]
[ext_resource type="Script" uid="uid://bsqvllp6h53jr" path="res://scripts/cube.gd" id="1_jbd7x"] [ext_resource type="Script" uid="uid://bsqvllp6h53jr" path="res://scripts/cube.gd" id="1_jbd7x"]
[ext_resource type="Texture2D" uid="uid://cpjqgpeoi58u7" path="res://assets/graphics/objects/pixil-frame-0.png" id="2_pw53m"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7j3e2"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_7j3e2"]
size = Vector2(54, 55)
[node name="cube" type="RigidBody2D" unique_id=1851497894 groups=["fragile"]] [node name="cube" type="RigidBody2D" unique_id=1851497894 groups=["fragile"]]
position = Vector2(17, 7)
script = ExtResource("1_jbd7x") script = ExtResource("1_jbd7x")
metadata/_edit_group_ = true metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=250973730] [node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=250973730]
position = Vector2(17, 17.5)
shape = SubResource("RectangleShape2D_7j3e2") shape = SubResource("RectangleShape2D_7j3e2")
debug_color = Color(0.15505362, 0.53664047, 0.94464076, 0.41960785) debug_color = Color(0.15505362, 0.53664047, 0.94464076, 0.41960785)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=509710592]
[node name="PixilFrame0" type="Sprite2D" parent="." unique_id=727761054]
texture_filter = 1
position = Vector2(17.000002, 17.5)
scale = Vector2(1.35, 1.375)
texture = ExtResource("2_pw53m")

View File

@ -1,4 +1,4 @@
[gd_scene format=3 uid="uid://btxq5hrirovod"] [gd_scene format=4 uid="uid://btxq5hrirovod"]
[ext_resource type="Script" uid="uid://jsnpm50wknk2" path="res://scripts/game.gd" id="1_qpk70"] [ext_resource type="Script" uid="uid://jsnpm50wknk2" path="res://scripts/game.gd" id="1_qpk70"]
[ext_resource type="Script" uid="uid://cxlpex21vgnla" path="res://scripts/scenemanager.gd" id="2_ll5lq"] [ext_resource type="Script" uid="uid://cxlpex21vgnla" path="res://scripts/scenemanager.gd" id="2_ll5lq"]
@ -6,15 +6,325 @@
[ext_resource type="Script" uid="uid://cdxh14mtlvhl6" path="res://scripts/trigger_circle.gd" id="4_yq8tf"] [ext_resource type="Script" uid="uid://cdxh14mtlvhl6" path="res://scripts/trigger_circle.gd" id="4_yq8tf"]
[ext_resource type="PackedScene" uid="uid://d0wbtenf13iol" path="res://scene/cube.tscn" id="5_ym5sv"] [ext_resource type="PackedScene" uid="uid://d0wbtenf13iol" path="res://scene/cube.tscn" id="5_ym5sv"]
[ext_resource type="PackedScene" uid="uid://d4nnj62h6fjcq" path="res://scene/character_body_2d.tscn" id="6_sng2h"] [ext_resource type="PackedScene" uid="uid://d4nnj62h6fjcq" path="res://scene/character_body_2d.tscn" id="6_sng2h"]
[ext_resource type="Texture2D" uid="uid://cmp7cdbeppphh" path="res://assets/graphics/Enviromentsf/Terrain (32x32).png" id="7_qpk70"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mwb40"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_mwb40"]
size = Vector2(368.333, 64.236694) size = Vector2(385.1665, 55.118347)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_mwb40"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_mwb40"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e2o6t"] [sub_resource type="CircleShape2D" id="CircleShape2D_e2o6t"]
radius = 153.83757 radius = 153.83757
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_ll5lq"]
texture = ExtResource("7_qpk70")
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/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
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/top_side = 0
13:0/0 = 0
13:0/0/terrain_set = 0
13:0/0/terrain = 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/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/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_right_corner = 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/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/terrains_peering_bit/bottom_right_corner = 0
10:3/0/terrains_peering_bit/bottom_side = 0
12:3/0 = 0
13:3/0 = 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_right_corner = 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/bottom_left_corner = 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/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/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
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_17rxn"]
tile_size = Vector2i(32, 32)
physics_layer_0/collision_layer = 1
terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "leafy dirt"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
sources/0 = SubResource("TileSetAtlasSource_ll5lq")
[node name="Game" type="Node2D" unique_id=1249397989] [node name="Game" type="Node2D" unique_id=1249397989]
script = ExtResource("1_qpk70") script = ExtResource("1_qpk70")
@ -29,11 +339,12 @@ position = Vector2(421, 536.99994)
script = ExtResource("3_17rxn") script = ExtResource("3_17rxn")
[node name="CollisionShape2D" type="CollisionShape2D" parent="platform" unique_id=469432658] [node name="CollisionShape2D" type="CollisionShape2D" parent="platform" unique_id=469432658]
position = Vector2(-37.416748, -25.440765)
shape = SubResource("RectangleShape2D_mwb40") shape = SubResource("RectangleShape2D_mwb40")
[node name="left wall" type="StaticBody2D" parent="." unique_id=1287017623] [node name="left wall" type="StaticBody2D" parent="." unique_id=1287017623]
position = Vector2(-143, 215) position = Vector2(749.99994, 381.00003)
rotation = 1.4884713 rotation = 2.5344458
script = ExtResource("3_17rxn") script = ExtResource("3_17rxn")
metadata/_edit_group_ = true metadata/_edit_group_ = true
@ -77,21 +388,27 @@ metadata/_edit_group_ = true
shape = SubResource("CircleShape2D_e2o6t") shape = SubResource("CircleShape2D_e2o6t")
[node name="cube container" type="Node2D" parent="." unique_id=22976120] [node name="cube container" type="Node2D" parent="." unique_id=22976120]
position = Vector2(226, 231)
[node name="cube" parent="cube container" unique_id=1851497894 instance=ExtResource("5_ym5sv")] [node name="cube" parent="cube container" unique_id=1851497894 instance=ExtResource("5_ym5sv")]
position = Vector2(429.00003, 372) position = Vector2(429.00003, 372)
scale = Vector2(0.97196096, 1.0195743) scale = Vector2(0.97196096, 1.0195743)
[node name="cube2" parent="cube container" unique_id=1345370216 instance=ExtResource("5_ym5sv")] [node name="cube2" parent="cube container" unique_id=1345370216 instance=ExtResource("5_ym5sv")]
position = Vector2(921, -508.99997) position = Vector2(496.00012, -234.00003)
scale = Vector2(0.97196096, 1.0195743) scale = Vector2(0.97196096, 1.0195743)
[node name="cube3" parent="cube container" unique_id=321996969 instance=ExtResource("5_ym5sv")] [node name="cube3" parent="cube container" unique_id=321996969 instance=ExtResource("5_ym5sv")]
position = Vector2(978.99994, -294) position = Vector2(353, -237.99998)
scale = Vector2(0.97196096, 1.0195743) scale = Vector2(0.97196096, 1.0195743)
[node name="CharacterBody2D" parent="." unique_id=44928680 instance=ExtResource("6_sng2h")] [node name="CharacterBody2D" parent="." unique_id=44928680 instance=ExtResource("6_sng2h")]
position = Vector2(263, 481) position = Vector2(337, 11)
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=1238523064]
position = Vector2(1, 0)
tile_map_data = PackedByteArray("AAAHAA8AAAAEAAAAAAAHABAAAAAEAAEAAAAIAA8AAAAEAAAAAAAIABAAAAAEAAEAAAAJAA8AAAAEAAAAAAAJABAAAAAEAAEAAAAKAA8AAAAEAAAAAAAKABAAAAAEAAEAAAALAA8AAAAEAAAAAAALABAAAAAEAAEAAAAMAA8AAAAEAAAAAAAMABAAAAAEAAEAAAANAA8AAAAEAAAAAAANABAAAAAEAAEAAAAOAA8AAAAEAAAAAAAOABAAAAAEAAEAAAAPAA8AAAAEAAAAAAAPABAAAAAEAAEAAAAQAA8AAAAEAAAAAAAQABAAAAAEAAEAAAARAA8AAAAEAAAAAAARABAAAAAEAAEAAAAGAA8AAAAEAAAAAAAGABAAAAAEAAEAAAATAA8AAAAEAAQAAAATAA4AAAAAAAQAAAAUAA4AAAACAAQAAAAUAA0AAAAAAAQAAAAVAA0AAAACAAQAAAAVAAwAAAAAAAQAAAAWAAwAAAABAAQAAAAXAAwAAAACAAQAAAAXAAsAAAAAAAQAAAAYAAsAAAABAAQAAAAZAAsAAAACAAQAAAAZAAoAAAAAAAQAAAAaAAoAAAACAAQAAAAaAAkAAAAAAAQAAAAbAAkAAAAQAAQAAAAbAAgAAAAEAAAAAAAcAAgAAAAEAAQAAAAcAAkAAAAEAAQAAAAaAAgAAAAEAAQAAAAZAAkAAAAEAAQAAAAYAAoAAAAEAAQAAAAWAAsAAAAEAAQAAAATAA0AAAAEAAQAAAASAA4AAAAEAAQAAAAVAA4AAAAEAAQAAAAWAA0AAAAEAAQAAAAXAAoAAAAEAAQAAAAYAAwAAAAEAAQAAAA=")
tile_set = SubResource("TileSet_17rxn")
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"] [connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
[connection signal="triggerActiveSignal" from="Area2D" to="." method="on_trigger"] [connection signal="triggerActiveSignal" from="Area2D" to="." method="on_trigger"]

View File

@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://c5mayb1i4ypqm"] [gd_scene format=3 uid="uid://c5mayb1i4ypqm"]
[ext_resource type="Script" uid="uid://wctwda5bor10" path="res://scripts/grenade.gd" id="1_gju2f"] [ext_resource type="Script" uid="uid://wctwda5bor10" path="res://scripts/grenade.gd" id="1_gju2f"]
[ext_resource type="Texture2D" uid="uid://cgd6djkjrq6g0" path="res://assets/graphics/objects/bomb.png" id="2_gt16k"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pu16u"] [sub_resource type="CircleShape2D" id="CircleShape2D_pu16u"]
@ -13,4 +14,9 @@ script = ExtResource("1_gju2f")
shape = SubResource("CircleShape2D_pu16u") shape = SubResource("CircleShape2D_pu16u")
debug_color = Color(0.45701438, 0.5945938, 3.85046e-07, 0.41960785) debug_color = Color(0.45701438, 0.5945938, 3.85046e-07, 0.41960785)
[node name="Bomb" type="Sprite2D" parent="." unique_id=462696120]
position = Vector2(3, -2.0000005)
scale = Vector2(0.97499996, 1.0500001)
texture = ExtResource("2_gt16k")
[connection signal="body_entered" from="." to="." method="_on_body_entered"] [connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -5,8 +5,9 @@ const JUMP_VELOCITY = -500.0
var direction var direction
enum FaceDirection{LEFT, RIGHT} enum FaceDirection{LEFT, RIGHT}
var facing:FaceDirection = FaceDirection.RIGHT var facing:FaceDirection = FaceDirection.RIGHT
enum player_state{IDLE,RUNNING} enum player_state{IDLE,RUNNING,JUMPING,FALLING}
var current_player_state:player_state = player_state.IDLE var current_player_state:player_state = player_state.IDLE
var upJump:bool = false
@onready var player_graphic: AnimatedSprite2D = $"player graphic" @onready var player_graphic: AnimatedSprite2D = $"player graphic"
@ -46,8 +47,12 @@ func handle_input()->void:
shoveDirection = -1 shoveDirection = -1
pushTarget.apply_central_impulse(Vector2(shoveDirection,0)*700) pushTarget.apply_central_impulse(Vector2(shoveDirection,0)*700)
# Get the input direction and handle the movement/deceleration. if Input.is_action_just_pressed("jump") and is_on_floor():
# As good practice, you should replace UI actions with custom gameplay actions. velocity.y = JUMP_VELOCITY
upJump = true
current_player_state = player_state.JUMPING
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
direction = Input.get_axis("ui_left", "ui_right") direction = Input.get_axis("ui_left", "ui_right")
if direction<0: if direction<0:
facing = FaceDirection.LEFT facing = FaceDirection.LEFT
@ -56,6 +61,8 @@ func handle_input()->void:
facing = FaceDirection.RIGHT facing = FaceDirection.RIGHT
player_graphic.flip_h = false player_graphic.flip_h = false
func handle_movement(delta)->void: func handle_movement(delta)->void:
if not is_on_floor(): if not is_on_floor():
velocity += get_gravity() * delta velocity += get_gravity() * delta
@ -90,6 +97,11 @@ func handle_state()->void:
current_player_state = player_state.RUNNING current_player_state = player_state.RUNNING
player_state.RUNNING when velocity.x ==0: player_state.RUNNING when velocity.x ==0:
current_player_state = player_state.IDLE current_player_state = player_state.IDLE
player_state.JUMPING when velocity.y >0:
current_player_state = player_state.FALLING
player_state.FALLING when is_on_floor():
current_player_state = player_state.IDLE
func handle_animation()->void: func handle_animation()->void:
match current_player_state: match current_player_state:
@ -97,3 +109,13 @@ func handle_animation()->void:
player_graphic.play("idle") player_graphic.play("idle")
player_state.RUNNING: player_state.RUNNING:
player_graphic.play("run") player_graphic.play("run")
player_state.JUMPING:
if upJump:
player_graphic.play("jump")
player_state.FALLING:
player_graphic.play("fall")
func _on_animation_finished() -> void:
match current_player_state:
player_state.JUMPING:
upJump = false