Files
Russell Sanborn 7d42ae3c9a Rename Dodge The Creeps files to snake case (#1084)
This follows the style guide:

- https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html#style-guide

For reference, a documentation PR exists to update references to the
demo.
2024-07-15 00:36:11 +02:00

31 lines
535 B
GDScript

extends CanvasLayer
signal start_game
func show_message(text):
$MessageLabel.text = text
$MessageLabel.show()
$MessageTimer.start()
func show_game_over():
show_message("Game Over")
await $MessageTimer.timeout
$MessageLabel.text = "Dodge the\nCreeps"
$MessageLabel.show()
await get_tree().create_timer(1).timeout
$StartButton.show()
func update_score(score):
$ScoreLabel.text = str(score)
func _on_StartButton_pressed():
$StartButton.hide()
start_game.emit()
func _on_MessageTimer_timeout():
$MessageLabel.hide()