From a7b42bd030efaaa70769cda2e368a42b7ead4942 Mon Sep 17 00:00:00 2001 From: rom Date: Mon, 26 Apr 2021 23:56:42 +0200 Subject: pause & puzzle solver --- scenes/pause.gd | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scenes/pause.gd') diff --git a/scenes/pause.gd b/scenes/pause.gd index 0115b1a..9820845 100644 --- a/scenes/pause.gd +++ b/scenes/pause.gd @@ -14,6 +14,12 @@ func _on_Resume_on_click(): get_tree().paused = false emit_signal("unpause") +func _unhandled_input(event): + if event is InputEventKey and event.pressed and event.scancode == KEY_ESCAPE: + if pause_menu.visible: + _on_Resume_on_click() + else: + pause() func _on_Main_Menu_on_click(): get_tree().paused = false -- cgit