15 lines
296 B
GDScript
15 lines
296 B
GDScript
extends Area2D
|
|
|
|
@onready var timer = $Timer
|
|
|
|
func _on_body_entered(body: Node2D) -> void:
|
|
print("You are dead.")
|
|
Engine.time_scale = 0.5
|
|
body.get_node("CollisionShape2D").queue_free()
|
|
timer.start()
|
|
|
|
|
|
func _on_timer_timeout() -> void:
|
|
Engine.time_scale = 1
|
|
get_tree().reload_current_scene()
|