ui; game saving and loading; bad guy movement; damage and death anims

This commit is contained in:
torontocaper committed 2025-11-10 21:17:55 -05:00
1 parent f0fec8bfc7
commit 09a6140d15
45 files changed
+534 -183

No files matched your search

+17 -8
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=4 uid="uid://cueixogtk70go"]
[gd_scene load_steps=22 format=4 uid="uid://cueixogtk70go"]
[ext_resource type="Script" uid="uid://b84pdw14l6gb6" path="res://scripts/scene_manager.gd" id="2_iywne"]
[ext_resource type="PackedScene" uid="uid://2pp1gtlflav8" path="res://scenes/trigger.tscn" id="2_yqjtg"]
@@ -8,6 +8,7 @@
[ext_resource type="Texture2D" uid="uid://ctrmx80fc52bt" path="res://graphics/objects/mushroom_32x64.png" id="5_0tnpc"]
[ext_resource type="PackedScene" uid="uid://yr1iqtid2ihb" path="res://scenes/small_crate.tscn" id="7_u5sy4"]
[ext_resource type="PackedScene" uid="uid://31idmjadvk3t" path="res://scenes/coin.tscn" id="9_0tnpc"]
[ext_resource type="PackedScene" uid="uid://bcybxyumd2qwf" path="res://scenes/ui.tscn" id="10_2y5yt"]
[ext_resource type="PackedScene" uid="uid://bts74sqcd7k7h" path="res://scenes/slimer.tscn" id="10_vtaks"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_gee14"]
@@ -411,7 +412,7 @@ texture_region_size = Vector2i(32, 32)
[sub_resource type="TileSet" id="TileSet_gee14"]
tile_size = Vector2i(32, 32)
physics_layer_0/collision_layer = 2
physics_layer_0/collision_mask = 13
physics_layer_0/collision_mask = 29
terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "Main Terrain"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
@@ -431,10 +432,10 @@ cellular_return_type = 0
domain_warp_enabled = true
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_u5sy4"]
noise = SubResource("FastNoiseLite_p57ef")
color_ramp = SubResource("Gradient_iywne")
seamless = true
in_3d_space = true
seamless = true
color_ramp = SubResource("Gradient_iywne")
noise = SubResource("FastNoiseLite_p57ef")
[sub_resource type="Gradient" id="Gradient_p57ef"]
offsets = PackedFloat32Array(0.513333, 0.846667, 0.926667)
@@ -445,9 +446,9 @@ noise_type = 5
frequency = 0.02
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_iywne"]
noise = SubResource("FastNoiseLite_u5sy4")
color_ramp = SubResource("Gradient_p57ef")
seamless = true
color_ramp = SubResource("Gradient_p57ef")
noise = SubResource("FastNoiseLite_u5sy4")
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
@@ -509,7 +510,7 @@ position = Vector2(532, 62)
scale = Vector2(0.594276, 0.546575)
intent = "powerup"
[node name="Crates" type="Node" parent="."]
[node name="Crates" type="Node" parent="." groups=["explodable", "punchable"]]
[node name="SmallCrate" parent="Crates" groups=["explodable", "punchable"] instance=ExtResource("7_u5sy4")]
z_index = 10
@@ -533,6 +534,10 @@ position = Vector2(-7, -210)
z_index = 5
position = Vector2(-49, 84)
[node name="Coin2" parent="Coins" instance=ExtResource("9_0tnpc")]
z_index = 5
position = Vector2(-317, 18)
[node name="Enemies" type="Node" parent="."]
[node name="Slimer" parent="Enemies" instance=ExtResource("10_vtaks")]
@@ -541,6 +546,10 @@ position = Vector2(-123, 85)
[node name="Slimer2" parent="Enemies" instance=ExtResource("10_vtaks")]
position = Vector2(53, 86)
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="UI" parent="CanvasLayer" instance=ExtResource("10_2y5yt")]
[connection signal="body_entered" from="WorldBoundary" to="SceneManager" method="_on_world_boundary_body_entered"]
[connection signal="trigger_fired" from="Triggers/Trigger" to="." method="_on_trigger_fired"]
[connection signal="trigger_fired" from="Triggers/Trigger2" to="." method="_on_trigger_fired"]
+6 -6
View File
@@ -438,10 +438,10 @@ cellular_return_type = 0
domain_warp_enabled = true
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_u5sy4"]
noise = SubResource("FastNoiseLite_p57ef")
color_ramp = SubResource("Gradient_iywne")
seamless = true
in_3d_space = true
seamless = true
color_ramp = SubResource("Gradient_iywne")
noise = SubResource("FastNoiseLite_p57ef")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hey2k"]
shader = ExtResource("2_hey2k")
@@ -455,9 +455,9 @@ noise_type = 5
frequency = 0.02
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_iywne"]
noise = SubResource("FastNoiseLite_u5sy4")
color_ramp = SubResource("Gradient_p57ef")
seamless = true
color_ramp = SubResource("Gradient_p57ef")
noise = SubResource("FastNoiseLite_u5sy4")
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
@@ -522,7 +522,7 @@ position = Vector2(532, 62)
scale = Vector2(0.594276, 0.546575)
intent = "powerup"
[node name="Crates" type="Node" parent="."]
[node name="Crates" type="Node" parent="." groups=["explodable", "punchable"]]
[node name="SmallCrate" parent="Crates" groups=["explodable", "punchable"] instance=ExtResource("7_guvtl")]
z_index = 10
+8 -8
View File
@@ -14,7 +14,7 @@
[sub_resource type="Gradient" id="Gradient_vcx5n"]
interpolation_mode = 1
offsets = PackedFloat32Array(0.1625, 0.34375, 0.56875, 0.6625, 0.775)
colors = PackedColorArray(0.20280002, 0.182, 0.26, 1, 0.37049997, 0.57, 0.473575, 1, 0.1953, 0.535815, 0.63, 1, 0.51, 0.3468, 0.46648005, 1, 0.66486335, 0.67, 0.3618, 1)
colors = PackedColorArray(0.2028, 0.182, 0.26, 1, 0.3705, 0.57, 0.473575, 1, 0.1953, 0.535815, 0.63, 1, 0.51, 0.3468, 0.46648, 1, 0.664863, 0.67, 0.3618, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_56dhn"]
gradient = SubResource("Gradient_vcx5n")
@@ -461,7 +461,7 @@ void fragment() {
[sub_resource type="Gradient" id="Gradient_56dhn"]
offsets = PackedFloat32Array(0.14375, 0.6125)
colors = PackedColorArray(0.19215687, 0.1882353, 0.22745098, 1, 0.9607843, 0.85490197, 0.6509804, 1)
colors = PackedColorArray(0.192157, 0.188235, 0.227451, 1, 0.960784, 0.854902, 0.65098, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ax3dk"]
gradient = SubResource("Gradient_56dhn")
@@ -480,10 +480,10 @@ cellular_return_type = 0
domain_warp_enabled = true
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_u5sy4"]
noise = SubResource("FastNoiseLite_p57ef")
color_ramp = SubResource("Gradient_iywne")
seamless = true
in_3d_space = true
seamless = true
color_ramp = SubResource("Gradient_iywne")
noise = SubResource("FastNoiseLite_p57ef")
[sub_resource type="Gradient" id="Gradient_p57ef"]
offsets = PackedFloat32Array(0.513333, 0.846667, 0.926667)
@@ -494,9 +494,9 @@ noise_type = 5
frequency = 0.02
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_iywne"]
noise = SubResource("FastNoiseLite_u5sy4")
color_ramp = SubResource("Gradient_p57ef")
seamless = true
color_ramp = SubResource("Gradient_p57ef")
noise = SubResource("FastNoiseLite_u5sy4")
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
@@ -561,7 +561,7 @@ position = Vector2(532, 62)
scale = Vector2(0.594276, 0.546575)
intent = "powerup"
[node name="Crates" type="Node" parent="."]
[node name="Crates" type="Node" parent="." groups=["explodable", "punchable"]]
[node name="SmallCrate" parent="Crates" groups=["explodable", "punchable"] instance=ExtResource("7_5xqnf")]
z_index = 10
+121 -5
View File
@@ -1,8 +1,10 @@
[gd_scene load_steps=60 format=3 uid="uid://d3y1iqmpknpyo"]
[gd_scene load_steps=76 format=3 uid="uid://d3y1iqmpknpyo"]
[ext_resource type="Script" uid="uid://d3hp5rjoph7hg" path="res://scripts/player.gd" id="1_3vyb7"]
[ext_resource type="Texture2D" uid="uid://dr3rp5hv7rexv" path="res://graphics/animations/player_idle/Player Idle 48x48.png" id="2_g2els"]
[ext_resource type="Texture2D" uid="uid://dcrb23f006glc" path="res://graphics/animations/player_death/Player Death 64x64.png" id="2_ur7pv"]
[ext_resource type="Texture2D" uid="uid://uxdt2cgxicmt" path="res://graphics/animations/player_jump/player jump 48x48.png" id="3_dqkch"]
[ext_resource type="Texture2D" uid="uid://cr8wqcakbcjnl" path="res://graphics/animations/player_hurt/Player Hurt 48x48.png" id="3_smehm"]
[ext_resource type="Texture2D" uid="uid://b27fd4xvrp2ov" path="res://graphics/animations/Player Jab 48x48.png" id="4_fjrip"]
[ext_resource type="Texture2D" uid="uid://bgp8oow6hgh5o" path="res://graphics/animations/player_run/player run 48x48.png" id="4_qlg0r"]
[ext_resource type="Texture2D" uid="uid://dadvc8tsvmkb6" path="res://graphics/animations/player_shoot/Player Running Shooting 48x48.png" id="5_tuyoq"]
@@ -38,7 +40,7 @@ void fragment() {
[sub_resource type="Gradient" id="Gradient_smehm"]
interpolation_mode = 1
offsets = PackedFloat32Array(0.2, 0.39375, 0.66875)
colors = PackedColorArray(0.14760001, 0.31398, 0.36, 1, 0.37254903, 0.78431374, 0.9019608, 1, 0.99215686, 0.99607843, 0.53333336, 1)
colors = PackedColorArray(0.1476, 0.31398, 0.36, 1, 0.372549, 0.784314, 0.901961, 1, 0.992157, 0.996078, 0.533333, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_ur7pv"]
gradient = SubResource("Gradient_smehm")
@@ -49,10 +51,66 @@ repeat = 1
shader = SubResource("Shader_fjrip")
shader_parameter/gradient_texture = SubResource("GradientTexture2D_ur7pv")
[sub_resource type="AtlasTexture" id="AtlasTexture_lxlsd"]
atlas = ExtResource("2_ur7pv")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ha2mi"]
atlas = ExtResource("2_ur7pv")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_apa73"]
atlas = ExtResource("2_ur7pv")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_74r1k"]
atlas = ExtResource("2_ur7pv")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_8svfe"]
atlas = ExtResource("2_ur7pv")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_2a3c5"]
atlas = ExtResource("2_ur7pv")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_42b1b"]
atlas = ExtResource("2_ur7pv")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_h7ic4"]
atlas = ExtResource("2_ur7pv")
region = Rect2(336, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_au7lq"]
atlas = ExtResource("2_ur7pv")
region = Rect2(384, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_nubpm"]
atlas = ExtResource("2_ur7pv")
region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_oprun"]
atlas = ExtResource("3_dqkch")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_j2b1d"]
atlas = ExtResource("3_smehm")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_cs1tg"]
atlas = ExtResource("3_smehm")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_2gdjj"]
atlas = ExtResource("3_smehm")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_sc3ue"]
atlas = ExtResource("3_smehm")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_qhqgy"]
atlas = ExtResource("2_g2els")
region = Rect2(0, 0, 48, 48)
@@ -237,6 +295,41 @@ region = Rect2(336, 0, 48, 48)
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lxlsd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ha2mi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_apa73")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_74r1k")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8svfe")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2a3c5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_42b1b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h7ic4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_au7lq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nubpm")
}],
"loop": false,
"name": &"die",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_oprun")
}],
"loop": true,
@@ -245,6 +338,23 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j2b1d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cs1tg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2gdjj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sc3ue")
}],
"loop": false,
"name": &"hurt",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qhqgy")
}, {
"duration": 1.0,
@@ -435,8 +545,10 @@ position = Vector2(-16, -7)
[node name="PlayerSprite" type="AnimatedSprite2D" parent="."]
material = SubResource("ShaderMaterial_y4r1p")
sprite_frames = SubResource("SpriteFrames_3vyb7")
animation = &"shoot_still"
animation = &"die"
autoplay = "idle"
frame = 9
frame_progress = 1.0
[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2(0, -50)
@@ -446,6 +558,10 @@ position_smoothing_enabled = true
[node name="StateLabel" type="Label" parent="DebugInfo"]
unique_name_in_owner = true
offset_right = 40.0
offset_bottom = 23.0
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -23.0
offset_right = 113.0
grow_vertical = 0
text = "Current State: "
+9 -3
View File
@@ -47,7 +47,7 @@ collision_layer = 16
collision_mask = 15
script = ExtResource("1_4oill")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
[node name="SlimeSprite" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_negjt")
animation = &"idle"
autoplay = "idle"
@@ -58,17 +58,23 @@ position = Vector2(0, 4.5)
shape = SubResource("RectangleShape2D_02r3y")
[node name="RightCast" type="RayCast2D" parent="."]
position = Vector2(1, 0)
target_position = Vector2(20, 0)
collision_mask = 3
[node name="LeftCast" type="RayCast2D" parent="."]
position = Vector2(1, 0)
target_position = Vector2(-20, 0)
collision_mask = 3
[node name="RightDownCast" type="RayCast2D" parent="."]
position = Vector2(7, 0)
position = Vector2(8, 0)
target_position = Vector2(0, 20)
collision_mask = 3
[node name="LeftDownCast" type="RayCast2D" parent="."]
position = Vector2(-7, 0)
position = Vector2(-6, 0)
target_position = Vector2(0, 20)
collision_mask = 3
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
+47
View File
@@ -0,0 +1,47 @@
[gd_scene load_steps=2 format=3 uid="uid://bcybxyumd2qwf"]
[ext_resource type="Script" uid="uid://bpyw8duggqhke" path="res://scripts/ui.gd" id="1_nt7q6"]
[node name="UI" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_nt7q6")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="HealthLabel" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer"]
layout_mode = 2
text = "Health"
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="TimerLabel" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer2"]
layout_mode = 2
text = "Timer"
horizontal_alignment = 1
[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="CoinsLabel" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer3"]
layout_mode = 2
text = "Coins"
horizontal_alignment = 2