Pause Menu and navigation
This commit is contained in:
@ -10,8 +10,8 @@ const enemies = [FORKMAN, COBOLD, ORK]
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
get_node("SidePanel").Update_Lifes(20)
|
||||
get_node("SidePanel").Update_Coins(2000)
|
||||
get_node("CanvasLayer/SidePanel").Update_Lifes(20)
|
||||
get_node("CanvasLayer/SidePanel").Update_Coins(2000)
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
@ -25,8 +25,8 @@ func spawnMonster():
|
||||
path_2d.add_child(path)
|
||||
|
||||
func decrease_life(damage) -> void:
|
||||
get_node("SidePanel").Update_Lifes(-damage)
|
||||
if get_node("SidePanel").get_Lifes() <= 0:
|
||||
get_node("CanvasLayer/SidePanel").Update_Lifes(-damage)
|
||||
if get_node("CanvasLayer/SidePanel").get_Lifes() <= 0:
|
||||
game_over()
|
||||
|
||||
func game_over()-> void:
|
||||
|
@ -508,12 +508,6 @@ curve = SubResource("Curve2D_6abe5")
|
||||
wait_time = 1.5
|
||||
autostart = true
|
||||
|
||||
[node name="SidePanel" parent="." instance=ExtResource("67_rec5e")]
|
||||
offset_left = -2.0
|
||||
offset_top = 583.0
|
||||
offset_right = 1152.0
|
||||
offset_bottom = 647.0
|
||||
|
||||
[node name="TrapArea" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TrapArea"]
|
||||
@ -553,4 +547,9 @@ shape = SubResource("RectangleShape2D_4tlg5")
|
||||
position = Vector2(1072.5, 230)
|
||||
shape = SubResource("RectangleShape2D_sglle")
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="SidePanel" parent="CanvasLayer" instance=ExtResource("67_rec5e")]
|
||||
size_flags_horizontal = 6
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
|
Reference in New Issue
Block a user