diff options
author | Logan <logan@cflip.net> | 2022-10-01 21:01:12 -0600 |
---|---|---|
committer | Logan <logan@cflip.net> | 2022-10-01 21:01:12 -0600 |
commit | d10bfcc48ebaf5dcdf58d25ff0c3c29a2a8157ad (patch) | |
tree | 856a802db5c1fb47f4858b7536f0250e1fd032bb /scripts/interface.gd | |
parent | c976e1bfefad2d3c8f7608c3ef436879794f3b9d (diff) |
Add next phase counter and improved interface script.
Diffstat (limited to 'scripts/interface.gd')
-rw-r--r-- | scripts/interface.gd | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/interface.gd b/scripts/interface.gd index 4a25ce3..6aab7dd 100644 --- a/scripts/interface.gd +++ b/scripts/interface.gd @@ -1,16 +1,23 @@ extends CanvasLayer var time_left = 30 +var phase_index = 0 func _ready(): - $ScoreLabel.text = "Score: " + str(global_variables.score) - $TimerLabel.text = "Time: " + str(time_left) + update_labels() $Timer.start() func _on_Hoop_score(): - $ScoreLabel.text = "Score: " + str(global_variables.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) |