summaryrefslogtreecommitdiff
path: root/scripts/interface.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/interface.gd')
-rw-r--r--scripts/interface.gd21
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/interface.gd b/scripts/interface.gd
index 453f468..138527d 100644
--- a/scripts/interface.gd
+++ b/scripts/interface.gd
@@ -1,7 +1,22 @@
-extends Label
+extends Control
+
+onready var timer_label = $"Timer Label"
+onready var timer = $"Timer Label/Timer"
+onready var score_label = $"Score Label"
func _ready():
- text = "Score: " + str(global_variables.score)
+ score_label.text = "Score: " + str(global_variables.score)
+ timer.start()
+ timer_label.text = "Time: " + str(timer.time_left)
+ $"Update Timer".start()
func _on_Hoop_score():
- text = "Score: " + str(global_variables.score)
+ score_label.text = "Score: " + str(global_variables.score)
+ timer.start(timer.get_time_left() + 10)
+ update_timer()
+
+func update_timer():
+ timer_label.text = "Time: " + str(round(timer.time_left))
+
+func _on_Update_Timer_timeout():
+ update_timer()