messag here

This commit is contained in:
tim 2026-06-01 21:07:37 -04:00
parent ae5d43d74e
commit e4a6130947
18 changed files with 363 additions and 33 deletions

47
Scenes/UI.tscn Normal file
View File

@ -0,0 +1,47 @@
[gd_scene format=3 uid="uid://b2mbs0mt6pfk1"]
[ext_resource type="Script" uid="uid://dlajwbi28mo3c" path="res://Scripts/ui.gd" id="1_w371h"]
[node name="Control" type="Control" unique_id=647295477]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_w371h")
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=1986399715]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer" unique_id=1201878653]
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer" unique_id=2066260090]
layout_mode = 2
size_flags_horizontal = 3
[node name="hEALTH" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer" unique_id=8299279]
layout_mode = 2
text = "HEALTH"
[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer" unique_id=722194416]
layout_mode = 2
size_flags_horizontal = 3
[node name="TIME" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer2" unique_id=262400277]
layout_mode = 2
text = "TIME"
horizontal_alignment = 1
[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer" unique_id=659233158]
layout_mode = 2
size_flags_horizontal = 3
[node name="CRATES" type="Label" parent="VBoxContainer/HBoxContainer/MarginContainer3" unique_id=426403136]
layout_mode = 2
text = "CRATES"
horizontal_alignment = 2

View File

@ -6,6 +6,7 @@
[ext_resource type="Script" uid="uid://kb3v21msvi17" path="res://Scripts/trigger.gd" id="3_wrm1d"] [ext_resource type="Script" uid="uid://kb3v21msvi17" path="res://Scripts/trigger.gd" id="3_wrm1d"]
[ext_resource type="Script" uid="uid://qhll446powxt" path="res://Scripts/scene_manager.gd" id="6_1l0tm"] [ext_resource type="Script" uid="uid://qhll446powxt" path="res://Scripts/scene_manager.gd" id="6_1l0tm"]
[ext_resource type="PackedScene" uid="uid://dkp7dy7npof2g" path="res://Scenes/slime.tscn" id="6_i6g32"] [ext_resource type="PackedScene" uid="uid://dkp7dy7npof2g" path="res://Scenes/slime.tscn" id="6_i6g32"]
[ext_resource type="PackedScene" uid="uid://b2mbs0mt6pfk1" path="res://Scenes/UI.tscn" id="7_1l0tm"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v158k"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v158k"]
texture = ExtResource("3_1l0tm") texture = ExtResource("3_1l0tm")
@ -13,13 +14,14 @@ texture_region_size = Vector2i(32, 32)
0:0/0 = 0 0:0/0 = 0
0:0/0/terrain_set = 0 0:0/0/terrain_set = 0
0:0/0/terrain = 0 0:0/0/terrain = 0
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4.4608307, -16, -4.1422005, 16, -16, 16) 0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
0:0/0/terrains_peering_bit/right_side = 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_right_corner = 0
0:0/0/terrains_peering_bit/bottom_side = 0 0:0/0/terrains_peering_bit/bottom_side = 0
1:0/0 = 0 1:0/0 = 0
1:0/0/terrain_set = 0 1:0/0/terrain_set = 0
1:0/0/terrain = 0 1:0/0/terrain = 0
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
1:0/0/terrains_peering_bit/right_side = 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_right_corner = 0
1:0/0/terrains_peering_bit/bottom_side = 0 1:0/0/terrains_peering_bit/bottom_side = 0
@ -28,7 +30,7 @@ texture_region_size = Vector2i(32, 32)
2:0/0 = 0 2:0/0 = 0
2:0/0/terrain_set = 0 2:0/0/terrain_set = 0
2:0/0/terrain = 0 2:0/0/terrain = 0
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(8.603031, -16, 16, -16, 16, 16, 8.603031, 16, 8.284401, 16) 2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
2:0/0/terrains_peering_bit/bottom_side = 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/bottom_left_corner = 0
2:0/0/terrains_peering_bit/left_side = 0 2:0/0/terrains_peering_bit/left_side = 0
@ -193,13 +195,14 @@ texture_region_size = Vector2i(32, 32)
0:2/0 = 0 0:2/0 = 0
0:2/0/terrain_set = 0 0:2/0/terrain_set = 0
0:2/0/terrain = 0 0:2/0/terrain = 0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4.4608307, -16, -4.1422005, 16, -16, 16) 0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
0:2/0/terrains_peering_bit/right_side = 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_side = 0
0:2/0/terrains_peering_bit/top_right_corner = 0 0:2/0/terrains_peering_bit/top_right_corner = 0
1:2/0 = 0 1:2/0 = 0
1:2/0/terrain_set = 0 1:2/0/terrain_set = 0
1:2/0/terrain = 0 1:2/0/terrain = 0
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
1:2/0/terrains_peering_bit/right_side = 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/left_side = 0
1:2/0/terrains_peering_bit/top_left_corner = 0 1:2/0/terrains_peering_bit/top_left_corner = 0
@ -208,7 +211,7 @@ texture_region_size = Vector2i(32, 32)
2:2/0 = 0 2:2/0 = 0
2:2/0/terrain_set = 0 2:2/0/terrain_set = 0
2:2/0/terrain = 0 2:2/0/terrain = 0
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8.603031, -16, 16, -16, 16, 16, 8.603031, 16, 8.284401, 16) 2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
2:2/0/terrains_peering_bit/left_side = 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_left_corner = 0
2:2/0/terrains_peering_bit/top_side = 0 2:2/0/terrains_peering_bit/top_side = 0
@ -220,7 +223,7 @@ texture_region_size = Vector2i(32, 32)
6:3/0 = 0 6:3/0 = 0
6:3/0/terrain_set = 0 6:3/0/terrain_set = 0
6:3/0/terrain = 0 6:3/0/terrain = 0
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3.5049381, -13.06386, -3.5049381, 16, -16, 16) 6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
6:3/0/terrains_peering_bit/right_side = 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/bottom_side = 0
6:3/0/terrains_peering_bit/top_side = 0 6:3/0/terrains_peering_bit/top_side = 0
@ -228,7 +231,7 @@ texture_region_size = Vector2i(32, 32)
7:3/0 = 0 7:3/0 = 0
7:3/0/terrain_set = 0 7:3/0/terrain_set = 0
7:3/0/terrain = 0 7:3/0/terrain = 0
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(8.921661, -16, 16, -16, 16, 16, 8.603031, 16) 7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
7:3/0/terrains_peering_bit/bottom_side = 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/left_side = 0
7:3/0/terrains_peering_bit/top_left_corner = 0 7:3/0/terrains_peering_bit/top_left_corner = 0
@ -236,7 +239,7 @@ texture_region_size = Vector2i(32, 32)
9:3/0 = 0 9:3/0 = 0
9:3/0/terrain_set = 0 9:3/0/terrain_set = 0
9:3/0/terrain = 0 9:3/0/terrain = 0
9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3.8235683, -16, -4.1422005) 9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
9:3/0/terrains_peering_bit/right_side = 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_side = 0
9:3/0/terrains_peering_bit/bottom_left_corner = 0 9:3/0/terrains_peering_bit/bottom_left_corner = 0
@ -244,7 +247,7 @@ texture_region_size = Vector2i(32, 32)
10:3/0 = 0 10:3/0 = 0
10:3/0/terrain_set = 0 10:3/0/terrain_set = 0
10:3/0/terrain = 0 10:3/0/terrain = 0
10:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3.8235683, -16, -4.1422005) 10:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
10:3/0/terrains_peering_bit/right_side = 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_right_corner = 0
10:3/0/terrains_peering_bit/bottom_side = 0 10:3/0/terrains_peering_bit/bottom_side = 0
@ -252,14 +255,14 @@ texture_region_size = Vector2i(32, 32)
12:3/0 = 0 12:3/0 = 0
12:3/0/terrain_set = 0 12:3/0/terrain_set = 0
12:3/0/terrain = 0 12:3/0/terrain = 0
12:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -6.691246, -16, -6.372616, 16, -16, 16) 12:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
12:3/0/terrains_peering_bit/right_side = 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/bottom_side = 0
12:3/0/terrains_peering_bit/top_side = 0 12:3/0/terrains_peering_bit/top_side = 0
13:3/0 = 0 13:3/0 = 0
13:3/0/terrain_set = 0 13:3/0/terrain_set = 0
13:3/0/terrain = 0 13:3/0/terrain = 0
13:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -3.8235683, -16, -4.1422005) 13:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
13:3/0/terrains_peering_bit/right_side = 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/bottom_side = 0
13:3/0/terrains_peering_bit/left_side = 0 13:3/0/terrains_peering_bit/left_side = 0
@ -299,7 +302,7 @@ texture_region_size = Vector2i(32, 32)
6:4/0 = 0 6:4/0 = 0
6:4/0/terrain_set = 0 6:4/0/terrain_set = 0
6:4/0/terrain = 0 6:4/0/terrain = 0
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -3.5049381, -13.06386, -3.5049381, 16, -16, 16) 6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
6:4/0/terrains_peering_bit/right_side = 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_right_corner = 0
6:4/0/terrains_peering_bit/bottom_side = 0 6:4/0/terrains_peering_bit/bottom_side = 0
@ -307,7 +310,7 @@ texture_region_size = Vector2i(32, 32)
7:4/0 = 0 7:4/0 = 0
7:4/0/terrain_set = 0 7:4/0/terrain_set = 0
7:4/0/terrain = 0 7:4/0/terrain = 0
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(8.921661, -16, 16, -16, 16, 16, 8.603031, 16) 7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
7:4/0/terrains_peering_bit/bottom_side = 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/bottom_left_corner = 0
7:4/0/terrains_peering_bit/left_side = 0 7:4/0/terrains_peering_bit/left_side = 0
@ -315,7 +318,7 @@ texture_region_size = Vector2i(32, 32)
9:4/0 = 0 9:4/0 = 0
9:4/0/terrain_set = 0 9:4/0/terrain_set = 0
9:4/0/terrain = 0 9:4/0/terrain = 0
9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 3.186306, 16, 2.5490456, 16, 16, -16, 16) 9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
9:4/0/terrains_peering_bit/right_side = 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/left_side = 0
9:4/0/terrains_peering_bit/top_left_corner = 0 9:4/0/terrains_peering_bit/top_left_corner = 0
@ -323,7 +326,7 @@ texture_region_size = Vector2i(32, 32)
10:4/0 = 0 10:4/0 = 0
10:4/0/terrain_set = 0 10:4/0/terrain_set = 0
10:4/0/terrain = 0 10:4/0/terrain = 0
10:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 3.186306, 16, 2.5490456, 16, 16, -16, 16) 10:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
10:4/0/terrains_peering_bit/right_side = 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/left_side = 0
10:4/0/terrains_peering_bit/top_side = 0 10:4/0/terrains_peering_bit/top_side = 0
@ -331,14 +334,14 @@ texture_region_size = Vector2i(32, 32)
12:4/0 = 0 12:4/0 = 0
12:4/0/terrain_set = 0 12:4/0/terrain_set = 0
12:4/0/terrain = 0 12:4/0/terrain = 0
12:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 5.7353554, 16, 6.372616, 16, 16, -16, 16) 12:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
12:4/0/terrains_peering_bit/right_side = 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/left_side = 0
12:4/0/terrains_peering_bit/top_side = 0 12:4/0/terrains_peering_bit/top_side = 0
13:4/0 = 0 13:4/0 = 0
13:4/0/terrain_set = 0 13:4/0/terrain_set = 0
13:4/0/terrain = 0 13:4/0/terrain = 0
13:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(8.284401, -16, 16, -16, 16, 16, 8.603031, 16) 13:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
13:4/0/terrains_peering_bit/bottom_side = 0 13:4/0/terrains_peering_bit/bottom_side = 0
13:4/0/terrains_peering_bit/bottom_left_corner = 0 13:4/0/terrains_peering_bit/bottom_left_corner = 0
13:4/0/terrains_peering_bit/left_side = 0 13:4/0/terrains_peering_bit/left_side = 0
@ -384,7 +387,7 @@ position = Vector2(-39, 148)
script = ExtResource("6_1l0tm") script = ExtResource("6_1l0tm")
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=2001245533] [node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=2001245533]
tile_map_data = PackedByteArray("AAALAAMAAAAEAAAAAAAMAAQAAAABAAQAAAANAAMAAAAEAAAAAAAMAAMAAAAEAAQAAAAMAAUAAAABAAQAAAANAAUAAAAJAAQAAAAPAAMAAAAEAAQAAAALAAQAAAAJAAEAAAANAAQAAAACAAEAAAALAAUAAAAKAAQAAAAKAAUAAAANAAMAAAAJAAUAAAANAAMAAAAIAAUAAAANAAMAAAAHAAUAAAANAAMAAAAGAAUAAAAPAAMAAAAFAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAABAAQAAAAQAAUAAAABAAQAAAARAAUAAAABAAQAAAASAAUAAAABAAQAAAATAAUAAAABAAQAAAAUAAUAAAABAAQAAAAVAAUAAAABAAQAAAA=") tile_map_data = PackedByteArray("AAALAAMAAAAEAAAAAAAMAAQAAAABAAAAAAANAAMAAAAEAAAAAAAMAAMAAAAEAAQAAAAPAAMAAAAEAAQAAAALAAQAAAAGAAQAAAANAAQAAAAHAAQAAAAFAAUAAAAAAAQAAAAGAAUAAAABAAQAAAAHAAUAAAABAAQAAAAIAAUAAAABAAQAAAAJAAUAAAABAAQAAAAKAAUAAAABAAQAAAALAAUAAAAKAAQAAAAMAAUAAAABAAIAAAANAAUAAAAJAAQAAAAOAAUAAAABAAQAAAAPAAUAAAABAAQAAAAQAAUAAAABAAQAAAARAAUAAAABAAQAAAASAAUAAAABAAQAAAATAAUAAAABAAQAAAAUAAUAAAABAAQAAAAVAAUAAAAKAAQAAAAWAAUAAAAJAAQAAAAXAAUAAAACAAQAAAAVAAQAAAAAAAAAAAAWAAQAAAANAAQAAAAWAAMAAAAEAAAAAAA=")
tile_set = SubResource("TileSet_h4fw4") tile_set = SubResource("TileSet_h4fw4")
[node name="platfrom" type="StaticBody2D" parent="." unique_id=446401574] [node name="platfrom" type="StaticBody2D" parent="." unique_id=446401574]
@ -425,10 +428,14 @@ position = Vector2(252, 66.99999)
[node name="Enemies" type="Node2D" parent="." unique_id=1049899688] [node name="Enemies" type="Node2D" parent="." unique_id=1049899688]
[node name="Slime" parent="Enemies" unique_id=1791005633 instance=ExtResource("6_i6g32")] [node name="Slime" parent="Enemies" unique_id=1791005633 instance=ExtResource("6_i6g32")]
position = Vector2(505, 148) position = Vector2(505, 150)
[node name="Slime2" parent="Enemies" unique_id=834201238 instance=ExtResource("6_i6g32")] [node name="Slime2" parent="Enemies" unique_id=834201238 instance=ExtResource("6_i6g32")]
position = Vector2(308, 147) position = Vector2(308, 147)
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1920919030]
[node name="Control" parent="CanvasLayer" unique_id=647295477 instance=ExtResource("7_1l0tm")]
[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_triggerSignal"] [connection signal="triggerActiveSignal" from="Area2D" to="." method="_on_triggerSignal"]

View File

@ -2,11 +2,69 @@
[ext_resource type="Script" uid="uid://b4efh8nwneqkf" path="res://Scripts/player.gd" id="1_v0iea"] [ext_resource type="Script" uid="uid://b4efh8nwneqkf" path="res://Scripts/player.gd" id="1_v0iea"]
[ext_resource type="Texture2D" uid="uid://p72rbg7thsvi" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_cvnsp"] [ext_resource type="Texture2D" uid="uid://p72rbg7thsvi" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_cvnsp"]
[ext_resource type="Texture2D" uid="uid://cikmdjl8tc17o" path="res://assets/graphics/player/Hurt/Player Hurt 48x48.png" id="2_fkybt"]
[ext_resource type="Texture2D" uid="uid://b524p0lnj8ftn" path="res://assets/graphics/player/jump_fall/player jump 48x48.png" id="2_vgqql"] [ext_resource type="Texture2D" uid="uid://b524p0lnj8ftn" path="res://assets/graphics/player/jump_fall/player jump 48x48.png" id="2_vgqql"]
[ext_resource type="Texture2D" uid="uid://c2vtgqubns1p8" path="res://assets/graphics/player/DEAD/Player Death 64x64.png" id="2_x3wgy"]
[ext_resource type="Texture2D" uid="uid://b74hvan7k63nk" path="res://assets/graphics/player/Run/player run 48x48.png" id="3_6t5aa"] [ext_resource type="Texture2D" uid="uid://b74hvan7k63nk" path="res://assets/graphics/player/Run/player run 48x48.png" id="3_6t5aa"]
[sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"] [sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_y6uwr"]
atlas = ExtResource("2_x3wgy")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_83xs0"]
atlas = ExtResource("2_x3wgy")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ypfnu"]
atlas = ExtResource("2_x3wgy")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_xuaoq"]
atlas = ExtResource("2_x3wgy")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_wohnl"]
atlas = ExtResource("2_x3wgy")
region = Rect2(192, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_36dho"]
atlas = ExtResource("2_x3wgy")
region = Rect2(240, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_yh6i2"]
atlas = ExtResource("2_x3wgy")
region = Rect2(288, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_nv4vc"]
atlas = ExtResource("2_x3wgy")
region = Rect2(336, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_8gxox"]
atlas = ExtResource("2_x3wgy")
region = Rect2(384, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_11gg7"]
atlas = ExtResource("2_x3wgy")
region = Rect2(432, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ijsl"]
atlas = ExtResource("2_fkybt")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_p1odr"]
atlas = ExtResource("2_fkybt")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_0gysh"]
atlas = ExtResource("2_fkybt")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_vfarp"]
atlas = ExtResource("2_fkybt")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_olqyp"] [sub_resource type="AtlasTexture" id="AtlasTexture_olqyp"]
atlas = ExtResource("2_vgqql") atlas = ExtResource("2_vgqql")
region = Rect2(96, 0, 48, 48) region = Rect2(96, 0, 48, 48)
@ -95,6 +153,58 @@ region = Rect2(336, 0, 48, 48)
animations = [{ animations = [{
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_y6uwr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_83xs0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ypfnu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xuaoq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wohnl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_36dho")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yh6i2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_nv4vc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8gxox")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_11gg7")
}],
"loop": false,
"name": &"DEAD",
"speed": 9.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ijsl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p1odr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0gysh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vfarp")
}],
"loop": false,
"name": &"Hurt",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_olqyp") "texture": SubResource("AtlasTexture_olqyp")
}], }],
"loop": false, "loop": false,
@ -195,7 +305,7 @@ position = Vector2(-17, -8)
texture_filter = 1 texture_filter = 1
position = Vector2(0, -6) position = Vector2(0, -6)
sprite_frames = SubResource("SpriteFrames_ukyrk") sprite_frames = SubResource("SpriteFrames_ukyrk")
animation = &"idle" animation = &"DEAD"
autoplay = "idle" autoplay = "idle"
[node name="Camera2D" type="Camera2D" parent="." unique_id=124446220] [node name="Camera2D" type="Camera2D" parent="." unique_id=124446220]

View File

@ -59,17 +59,17 @@ position = Vector2(0, 1.5)
shape = SubResource("RectangleShape2D_vblni") shape = SubResource("RectangleShape2D_vblni")
[node name="Rightcast" type="RayCast2D" parent="." unique_id=1783847293] [node name="Rightcast" type="RayCast2D" parent="." unique_id=1783847293]
target_position = Vector2(12, 0) target_position = Vector2(16, 0)
[node name="LeftCast" type="RayCast2D" parent="." unique_id=500912486] [node name="LeftCast" type="RayCast2D" parent="." unique_id=500912486]
target_position = Vector2(-12, 0) target_position = Vector2(-15, 0)
[node name="LeftDownCast" type="RayCast2D" parent="." unique_id=586259475] [node name="LeftDownCast" type="RayCast2D" parent="." unique_id=586259475]
position = Vector2(-7, 0) position = Vector2(-9, 0)
target_position = Vector2(0, 14) target_position = Vector2(0, 12)
[node name="RightDownCast" type="RayCast2D" parent="." unique_id=54037895] [node name="RightDownCast" type="RayCast2D" parent="." unique_id=54037895]
position = Vector2(7, 0) position = Vector2(9, 0)
target_position = Vector2(0, 14) target_position = Vector2(0, 12)
[connection signal="body_entered" from="." to="." method="_on_body_entered"] [connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -2,6 +2,9 @@ extends Node2D
signal destroySignal(body) signal destroySignal(body)
signal levelChangeSignal(level) signal levelChangeSignal(level)
signal damagePlayerSignal(damageTotal, playerHealthTotal)
signal killPlayerSignal
signal timechangesignal(currenttimeavailable)
var levels = ["res://Scenes/game.tscn","res://Scenes/level 2.tscn","res://Scenes/level3.tscn"] var levels = ["res://Scenes/game.tscn","res://Scenes/level 2.tscn","res://Scenes/level3.tscn"]
var currentLevel = 0 var currentLevel = 0
@ -15,9 +18,14 @@ var playerCurrentHealth:int = 100
#enemies #enemies
var enemiesDict = {} var enemiesDict = {}
var enemy:CharacterStats
var player:CharacterStats
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
get_window().grab_focus() get_window().grab_focus()
enemy = load("res://Scripts/rscs/slime_stats.tres")
player = load("res://Scripts/rscs/player_sats.tres")
add_child(timer) add_child(timer)
timer.wait_time = 1 timer.wait_time = 1
timer.one_shot = false timer.one_shot = false
@ -27,6 +35,7 @@ func _ready() -> void:
func secondCounter()->void: func secondCounter()->void:
print("tick") print("tick")
timeAvailable-=1 timeAvailable-=1
timechangesignal.emit(timeAvailable)
if timeAvailable <=0: if timeAvailable <=0:
print ("you loose!") print ("you loose!")
levelChangeSignal.emit(levels[currentLevel]) levelChangeSignal.emit(levels[currentLevel])
@ -34,7 +43,7 @@ func secondCounter()->void:
func reset() -> void: func reset() -> void:
timeAvailable = timers[currentLevel] timeAvailable = timers[currentLevel]
playerCurrentHealth = 100 playerCurrentHealth = player.starting_health
get_window().grab_focus() get_window().grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
@ -60,16 +69,21 @@ func _on_slime_damage(_body, slime)->void:
print ("GC knows slime doing damage") print ("GC knows slime doing damage")
print("doing damage: "+str(enemiesDict[slime]["damage"])) print("doing damage: "+str(enemiesDict[slime]["damage"]))
playerCurrentHealth -= enemiesDict[slime]["damage"] playerCurrentHealth -= enemiesDict[slime]["damage"]
#send a custom signal about damage
damagePlayerSignal.emit(enemiesDict[slime]["damage"], playerCurrentHealth)
if playerCurrentHealth <=0: if playerCurrentHealth <=0:
print ("U ded") print ("U ded")
levelChangeSignal.emit(levels[currentLevel]) killPlayerSignal.emit()
func addEnemyToLevel(slime)->void: func addEnemyToLevel(slime)->void:
#give each enemy some health and damage #give each enemy some health and damage
var randamage = randi_range(1,20) var randamage = randi_range(1,20)
var enemyStat = { var enemyStat = {
"health": 50, "health": enemy.starting_health,
"damage": 30+randamage "damage": enemy.meleeDamage+randamage
} }
enemiesDict[slime]=enemyStat enemiesDict[slime]=enemyStat
func respawn()->void:
levelChangeSignal.emit(levels[currentLevel])

View File

@ -7,16 +7,19 @@ const JUMP_VELOCITY = -400.0
@onready var left_spawn: Marker2D = $LeftSpawn @onready var left_spawn: Marker2D = $LeftSpawn
@onready var player_graphic: AnimatedSprite2D = $PlayerGraphic @onready var player_graphic: AnimatedSprite2D = $PlayerGraphic
signal deathAnimationComplete
var direction var direction
enum FaceDirection{LEFT,RIGHT} enum FaceDirection{LEFT,RIGHT}
var facing:FaceDirection = FaceDirection.RIGHT var facing:FaceDirection = FaceDirection.RIGHT
enum PlayerState{IDLE,RUNNING,JUMPING,FALLING} enum PlayerState{IDLE,RUNNING,JUMPING,FALLING,HURT,DEAD}
var current_player_state:PlayerState = PlayerState.IDLE var current_player_state:PlayerState = PlayerState.IDLE
var upjump:bool = false var upjump:bool = false
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
handle_input() if not current_player_state == PlayerState.HURT:
handle_input()
handle_state() handle_state()
handle_animation() handle_animation()
@ -88,6 +91,10 @@ func handle_animation()->void:
player_graphic.play("jump") player_graphic.play("jump")
PlayerState.FALLING: PlayerState.FALLING:
player_graphic.play("fall") player_graphic.play("fall")
PlayerState.HURT:
player_graphic.play("Hurt")
PlayerState.DEAD:
player_graphic.play("dead")
@ -95,3 +102,12 @@ func _on_animation_finished() -> void:
match current_player_state: match current_player_state:
PlayerState.JUMPING: PlayerState.JUMPING:
upjump = false upjump = false
PlayerState.HURT:
current_player_state = PlayerState.IDLE
PlayerState.DEAD:
deathAnimationComplete.emit()
func takeDamage(_damage,_remainingHealth)->void:
print("Players knows damage"+str(_damage))
current_player_state = PlayerState.HURT
func die()->void:
current_player_state = PlayerState.DEAD

View File

@ -0,0 +1,8 @@
class_name CharacterStats extends Resource
@export var health:int = 100
@export var max_health:int = 120
@export var starting_health = 100
@export var meleeDamage:int = 10
@export var rangeDamage:int = 5

View File

@ -0,0 +1 @@
uid://btjirk5r5r50v

View File

@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="CharacterStats" format=3 uid="uid://cobe3kt6pn1wb"]
[ext_resource type="Script" uid="uid://btjirk5r5r50v" path="res://Scripts/rscs/character_stats.gd" id="1_jiogy"]
[resource]
script = ExtResource("1_jiogy")
health = 110
metadata/_custom_type_script = "uid://btjirk5r5r50v"

View File

@ -0,0 +1,11 @@
[gd_resource type="Resource" script_class="CharacterStats" format=3 uid="uid://c0xhd2g03rcls"]
[ext_resource type="Script" uid="uid://btjirk5r5r50v" path="res://Scripts/rscs/character_stats.gd" id="1_38j4j"]
[resource]
script = ExtResource("1_38j4j")
health = 40
max_health = 45
starting_health = 40
rangeDamage = 0
metadata/_custom_type_script = "uid://btjirk5r5r50v"

View File

@ -3,12 +3,19 @@ class_name SceneManager extends Node2D
@onready var crates: Node2D = $"../Crates" @onready var crates: Node2D = $"../Crates"
var grenade = preload("res://Scenes/grenade.tscn") var grenade = preload("res://Scenes/grenade.tscn")
@onready var enemies: Node2D = $"../Enemies" @onready var enemies: Node2D = $"../Enemies"
@onready var player = $"../Player"
@onready var control = $"../CanvasLayer/Control"
func _ready() -> void: func _ready() -> void:
GameController.reset() GameController.reset()
print("Scene manager is ready!") print("Scene manager is ready!")
GameController.destroySignal.connect(destroy) GameController.destroySignal.connect(destroy)
GameController.levelChangeSignal.connect(changeScene) GameController.levelChangeSignal.connect(changeScene)
GameController.damagePlayerSignal.connect(player.takeDamage)
GameController.damagePlayerSignal.connect((control.updatehealth))
GameController.timechangesignal.connect(control.updatetime)
GameController.killPlayerSignal.connect(player.die)
player.deathAnimationComplete.connect(GameController.respawn)
buildLevel() buildLevel()
func destroy(body)->void: func destroy(body)->void:

View File

@ -15,13 +15,16 @@ func _process(delta: float) -> void:
if rightcast.is_colliding() and not rightcast.get_collider() is Player: if rightcast.is_colliding() and not rightcast.get_collider() is Player:
direction = -1 direction = -1
slime_graphic.flip_h = true slime_graphic.flip_h = true
if left_cast.is_colliding() and not left_cast.get_collider() is Player: if left_cast.is_colliding() and not left_cast.get_collider() is Player:
direction = 1 direction = 1
slime_graphic.flip_h = false slime_graphic.flip_h = false
if not right_down_cast.is_colliding(): if not right_down_cast.is_colliding():
direction = -1 direction = -1
slime_graphic.flip_h = true slime_graphic.flip_h = true
if not left_cast.is_colliding():
if not left_down_cast.is_colliding():
direction = +1 direction = +1
slime_graphic.flip_h = false slime_graphic.flip_h = false

17
Scripts/ui.gd Normal file
View File

@ -0,0 +1,17 @@
extends Control
@onready var health = $VBoxContainer/HBoxContainer/MarginContainer/hEALTH
@onready var time = $VBoxContainer/HBoxContainer/MarginContainer2/TIME
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
health.text = "boombastic"
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func updatehealth(_damage,_health)->void:
health.text = "Health"+str(_health)
func updatetime (timeavailable)->void:
time.text = str(timeavailable)

1
Scripts/ui.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://dlajwbi28mo3c

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c2vtgqubns1p8"
path="res://.godot/imported/Player Death 64x64.png-98bd69b60fbf82e63e73cc68f91dafb5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/player/DEAD/Player Death 64x64.png"
dest_files=["res://.godot/imported/Player Death 64x64.png-98bd69b60fbf82e63e73cc68f91dafb5.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.4 KiB

View File

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