extends Control


export var time = 80

func _ready():
	$Timer.start(time)
	
	
func _process(delta):
	$VBoxContainer/Control/Label.text = str(ceil($Timer.time_left))
	
	var tl = $Timer.time_left
	
	if tl > 70:
		$VBoxContainer/Label.text = "get out of there!"
	elif tl > 60:
		$VBoxContainer/Label.text = "a bit faster?"
	elif tl > 50:
		$VBoxContainer/Label.text = "you should hurry"
	elif tl > 40:
		$VBoxContainer/Label.text = "oh no"
	elif tl > 30:
		$VBoxContainer/Label.text = "40 seconds left"
	elif tl > 20:
		$VBoxContainer/Label.text = "fine, take your time"
	elif tl > 10:
		$VBoxContainer/Label.text = "you're doomed"
	elif tl > 0:
		$VBoxContainer/Label.text = "goodbye"


func _on_Timer_timeout():
	get_tree().call_group("player","die")
	queue_free()
