extends CanvasLayer var time_left = 30 var phase_index = 0 var phase_type = ["RANDOM", "INCREASED RANGE"] var paused = false 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 $Difficulty/ChangeLabel.text = phase_type[$"../Basketball".phase - 1] $Difficulty/AnimationPlayer.play("blinking") var phase_difference = $"../Basketball".phase_increment[phase_index] - global_variables.score if phase_difference >= 0: $PhaseLabel.text = "Next Phase: " + str($"../Basketball".phase_increment[phase_index] - global_variables.score) func update_timer(): $TimerLabel.set_text("%03d" % time_left) func _on_Timer_timeout(): if time_left > 0: time_left -= 1 update_timer() else: global_variables.timer_zero = true $Timer.stop() $LoseLabel.visible = true