blob: 8aff53b453669443069426d1d6a29f2b44d7b308 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
extends CanvasLayer
var time_left = 30
func _ready():
$ScoreLabel.text = "Score: " + str(global_variables.score)
$TimerLabel.text = "Time: " + str(time_left)
$Timer.start()
func _on_Hoop_score():
if time_left > 0:
$ScoreLabel.text = "Score: " + str(global_variables.score)
time_left += 10
update_timer()
func update_timer():
$TimerLabel.text = "Time: " + str(time_left)
func _on_Timer_timeout():
time_left -= 1
update_timer()
|