From 328dd06a1d767710f9b9250f25304dd8d29b691f Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Sat, 25 Nov 2023 23:27:06 -0500 Subject: [PATCH] fixed bug where you could pause and go to debug level select durinh game over slowdown --- autoloads/debug.gd | 3 ++- autoloads/game.gd | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/autoloads/debug.gd b/autoloads/debug.gd index 8f39066..cc79c05 100644 --- a/autoloads/debug.gd +++ b/autoloads/debug.gd @@ -55,7 +55,8 @@ func _physics_process(delta): Game.change_map(load("res://maps/test_room.tscn")) #Debug 1 if Input.is_action_just_pressed("debug_1"): - Game.change_map(load("res://maps/level_select.tscn")) + if Game.can_pause: + Game.change_map(load("res://maps/level_select.tscn")) #Debug 2 if Input.is_action_just_pressed("debug_2"): Game.freeze_frame(1.0) diff --git a/autoloads/game.gd b/autoloads/game.gd index 27398ff..2228408 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -252,6 +252,7 @@ func _on_player_died() -> void: deaths += 1 if use_lives and lives <= 0: can_restart = false + can_pause = false Audio.play_sound(Audio.a_game_over, Audio.ac_die) get_tree().get_nodes_in_group("player")[0].queue_free() var time_tween = create_tween() @@ -266,6 +267,7 @@ func _on_player_died() -> void: var gover = load("res://menus/game_over.tscn").instance() map.add_child(gover) can_restart = true + can_pause = true else: # count death lives -= 1