update player death and add global node enum

This commit is contained in:
2025-10-21 12:03:48 +01:00
parent deec0fb581
commit add900d0f5
5 changed files with 18 additions and 2 deletions

View File

@@ -2,10 +2,15 @@ extends Area2D
@onready var timer: Timer = $Timer
func _on_body_entered(_body: Node2D) -> void:
func _on_body_entered(player_body: Node2D) -> void:
print("You died.")
Engine.time_scale = 0.5
player_body.get_node(NodeTypes.COLLISION_SHAPE_2D).queue_free()
var player_character_body = player_body as CharacterBody2D
player_character_body.velocity.y = -100
timer.start()
func _on_timer_timeout() -> void:
Engine.time_scale = 1
get_tree().reload_current_scene()