From 451d7103261d26c77f6cb5f513e81dcf47333c84 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Fri, 2 Aug 2024 17:27:23 +0100 Subject: [PATCH] escape key on pause --- Pause/PauseKeyPressed.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Pause/PauseKeyPressed.lua b/Pause/PauseKeyPressed.lua index cc047c5..bbd3523 100644 --- a/Pause/PauseKeyPressed.lua +++ b/Pause/PauseKeyPressed.lua @@ -1,7 +1,19 @@ function PauseKeyPressed(key) + if key == "escape" then + -- quickly return to the game + if not _G.MUTED then + musicBattle:setVolume(0.5) + musicPause:setVolume(0) + else + musicBattle:setVolume(0) + musicPause:setVolume(0) + end + _G.GAMESTATE = "GAME" + end + if key == "return" then -- quickly return to the game - if not MUTED then + if not _G.MUTED then musicBattle:setVolume(0.5) musicPause:setVolume(0) else