extends CanvasLayer


signal start_game


func show_message(text):
	$MessageLabel.text = text
	$MessageLabel.show()
	$MessageTimer.start()


func show_game_over():
	show_message("Game Over")
	yield($MessageTimer, "timeout")
	$MessageLabel.text = "Dodge again?"
	$MessageLabel.show()
	yield(get_tree().create_timer(1.0), "timeout")
	$ColorButton.show()
	$MenuButton.show()


func update_score(score):
	$ScoreLabel.text = str(score)


func _on_MessageTimer_timeout():
	$MessageLabel.hide()


func _on_StartButton_pressed():
	$ColorButton.hide()
	$MenuButton.hide()
	$MenuDialog.hide()
	emit_signal("start_game")
