extends CanvasLayer var time_left = 30 var phase_index = 0 func _ready(): update_labels() $Timer.start() func _on_Hoop_score(): time_left += 10 update_labels() func update_labels(): update_timer() $ScoreLabel.text = "Score: " + str(global_variables.score) if phase_index < $"../Basketball".phase_increment.size() - 1: if $"../Basketball".phase_increment[phase_index] <= global_variables.score: phase_index += 1 $PhaseLabel.text = "Next Phase: " + str($"../Basketball".phase_increment[phase_index] - global_variables.score) func update_timer(): $TimerLabel.text = "Time: " + str(time_left) func _on_Timer_timeout(): if time_left > 0: time_left -= 1 update_timer() else: global_variables.timer_zero = true $Timer.stop() $Control.visible = true