summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/interface.gd10
-rw-r--r--scripts/pausemenu.gd27
2 files changed, 35 insertions, 2 deletions
diff --git a/scripts/interface.gd b/scripts/interface.gd
index a242ae2..d61b8d5 100644
--- a/scripts/interface.gd
+++ b/scripts/interface.gd
@@ -2,6 +2,8 @@ extends CanvasLayer
var time_left = 30
var phase_index = 0
+var phase_type = ["RANDOM", "INCREASED RANGE"]
+var paused = false
func _ready():
update_labels()
@@ -17,7 +19,11 @@ func update_labels():
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)
+ $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)
@@ -29,4 +35,4 @@ func _on_Timer_timeout():
else:
global_variables.timer_zero = true
$Timer.stop()
- $Control.visible = true
+ $LoseLabel.visible = true
diff --git a/scripts/pausemenu.gd b/scripts/pausemenu.gd
new file mode 100644
index 0000000..6b0acdb
--- /dev/null
+++ b/scripts/pausemenu.gd
@@ -0,0 +1,27 @@
+extends Control
+
+func _input(event):
+ if event.is_action_pressed("escape"):
+ var pause_toggle = !get_tree().paused
+ get_tree().paused = pause_toggle
+ visible = pause_toggle
+
+func _on_RestartButton_pressed():
+ get_tree().reload_current_scene()
+ get_tree().paused = false
+ reset_variables()
+
+func _on_HelpButton_pressed():
+ pass
+
+func _on_OptionsButton_pressed():
+ pass
+
+func _on_QuitButton_pressed():
+ get_tree().change_scene("res://scenes/mainmenu.tscn")
+ get_tree().paused = false
+ reset_variables()
+
+func reset_variables():
+ global_variables.score = 0
+ global_variables.timer_zero = false