summaryrefslogtreecommitdiff
path: root/scenes/levels/reactiontest.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scenes/levels/reactiontest.gd')
-rw-r--r--scenes/levels/reactiontest.gd12
1 files changed, 9 insertions, 3 deletions
diff --git a/scenes/levels/reactiontest.gd b/scenes/levels/reactiontest.gd
index ba6d97b..d9db685 100644
--- a/scenes/levels/reactiontest.gd
+++ b/scenes/levels/reactiontest.gd
@@ -8,14 +8,19 @@ var timer = 0
func _total_time():
if Settings.difficulty == Settings.Difficulty.HARD:
- return 4
- return 6
+ return 6
+ if Settings.difficulty == Settings.Difficulty.PEACEFUL:
+ return 60
+ return 10
func start():
.start()
+var started = false
+
func _ready():
timer = 0
+ started = false
for i in range(buttons.size()):
buttons[i].connect("on_click", self, "_on_Any_button_click", [i])
buttons[i].text = str(i + 1)
@@ -23,13 +28,14 @@ func _ready():
buttons[i].visible = false
func _process(delta):
- if running:
+ if running and started:
timer += delta
timer_label.text = str(_total_time() - timer)
if timer >= _total_time():
lose_all_hearts()
func _on_Any_button_click(btn_idx):
+ started = true
if btn_idx == sequence_index:
sequence_index += 1
if sequence_index == buttons.size():