extends Area2D

@onready var timer: Timer = $Timer
@onready var death: AudioStreamPlayer2D = $Death

func _on_body_entered(player_body: Node2D) -> void:
	print("You died.")
	death.play()
	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()
