From 5b4008a55c50b5e1282427f0a2c0f61c2baef3e8 Mon Sep 17 00:00:00 2001 From: adrienmalin <41926238+adrienmalin@users.noreply.github.com> Date: Tue, 15 Jan 2019 16:05:09 +0100 Subject: [PATCH] new level --- source/Main.gd | 16 +++++++++------- source/Main.tscn | 2 +- source/Stats.gd | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/source/Main.gd b/source/Main.gd index e47601a..f352265 100644 --- a/source/Main.gd +++ b/source/Main.gd @@ -83,7 +83,7 @@ func random_piece(): add_child(piece) return piece -func _on_Stats_level_up(level): +func new_level(level): if level <= 15: $DropTimer.wait_time = pow(0.8 - ((level - 1) * 0.007), level - 1) else: @@ -127,12 +127,12 @@ func _unhandled_input(event): hold() func _on_AutoShiftDelay_timeout(): - if playing and autoshift_action: + if autoshift_action: process_autoshift() $AutoShiftTimer.start() func _on_AutoShiftTimer_timeout(): - if playing and autoshift_action: + if autoshift_action: process_autoshift() func process_autoshift(): @@ -207,6 +207,12 @@ func resume(): func pause(gui=null): playing = false + $MidiPlayer.stop() + $DropTimer.stop() + $LockDelay.stop() + $AutoShiftDelay.stop() + $AutoShiftTimer.stop() + $Stats/Clock.stop() $Stats.time = OS.get_system_time_secs() - $Stats.time if gui: gui.visible = true @@ -216,10 +222,6 @@ func pause(gui=null): if held_piece: held_piece.visible = false next_piece.visible = false - $MidiPlayer.stop() - $DropTimer.stop() - $LockDelay.stop() - $Stats/Clock.stop() func game_over(): pause() diff --git a/source/Main.tscn b/source/Main.tscn index 4ad8ee3..17174ea 100644 --- a/source/Main.tscn +++ b/source/Main.tscn @@ -559,7 +559,7 @@ _sections_unfolded = [ "Margin", "custom_colors", "custom_fonts" ] [connection signal="flash_text" from="Stats" to="FlashText" method="print"] -[connection signal="level_up" from="Stats" to="." method="_on_Stats_level_up"] +[connection signal="level_up" from="Stats" to="." method="new_level"] [connection signal="start" from="Start" to="." method="new_game"] diff --git a/source/Stats.gd b/source/Stats.gd index 9dd2f69..d2c648d 100644 --- a/source/Stats.gd +++ b/source/Stats.gd @@ -36,7 +36,7 @@ func new_level(): $VBC/Level.text = str(level) $VBC/Goal.text = str(goal) emit_signal("flash_text", "Level\n%d"%level) - emit_signal("level_up") + emit_signal("level_up", level) func _on_Clock_timeout(): show_time()