-
Notifications
You must be signed in to change notification settings - Fork 0
/
hud.gd
42 lines (26 loc) · 781 Bytes
/
hud.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
extends CanvasLayer
signal start_game
func show_message(text):
$Message.text = text
$Message.show()
$MessageTimer.start()
func show_game_over():
show_message("Game Over")
await $MessageTimer.timeout
$Message.text = "Dodge the Creeeps!"
$Message.show()
await get_tree().create_timer(1.0).timeout
$StartButton.show()
func update_score(score):
$ScoreLabel.text = str(score)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
pass
func _on_start_button_pressed() -> void:
$StartButton.hide()
start_game.emit()
func _on_message_timer_timeout() -> void:
$Message.hide()