mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2024-12-21 13:56:50 +01:00
31 lines
551 B
GDScript3
31 lines
551 B
GDScript3
|
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 the\nCreeps"
|
||
|
$MessageLabel.show()
|
||
|
yield(get_tree().create_timer(1), "timeout")
|
||
|
$StartButton.show()
|
||
|
|
||
|
|
||
|
func update_score(score):
|
||
|
$ScoreLabel.text = str(score)
|
||
|
|
||
|
|
||
|
func _on_StartButton_pressed():
|
||
|
$StartButton.hide()
|
||
|
emit_signal("start_game")
|
||
|
|
||
|
|
||
|
func _on_MessageTimer_timeout():
|
||
|
$MessageLabel.hide()
|