|
|
@ -1,20 +1,30 @@ |
|
|
|
function PauseKeyPressed(key) |
|
|
|
function PauseKeyPressed(key) |
|
|
|
if key == "return" then |
|
|
|
if key == "return" then |
|
|
|
-- quickly return to the game |
|
|
|
-- quickly return to the game |
|
|
|
musicBattle:setVolume(0.5) |
|
|
|
if not MUTED then |
|
|
|
musicPause:setVolume(0) |
|
|
|
musicBattle:setVolume(0.5) |
|
|
|
|
|
|
|
musicPause:setVolume(0) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
musicBattle:setVolume(0) |
|
|
|
|
|
|
|
musicPause:setVolume(0) |
|
|
|
|
|
|
|
end |
|
|
|
-- 0 Return to game |
|
|
|
-- 0 Return to game |
|
|
|
-- 1 Quit |
|
|
|
-- 1 Quit |
|
|
|
if PAUSE_POS == 0 then |
|
|
|
if PAUSE_POS == 0 then |
|
|
|
-- unpause the game |
|
|
|
-- unpause the game |
|
|
|
_G.GAMESTATE = "GAME" |
|
|
|
_G.GAMESTATE = "GAME" |
|
|
|
print("STATE CHANEGD: GAME!") |
|
|
|
--print("STATE CHANEGD: GAME!") |
|
|
|
_G.PAUSED = false |
|
|
|
_G.PAUSED = false |
|
|
|
musicBattle:setVolume(0.5) |
|
|
|
if not MUTED then |
|
|
|
musicPause:setVolume(0) |
|
|
|
musicBattle:setVolume(0.5) |
|
|
|
|
|
|
|
musicPause:setVolume(0) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
musicBattle:setVolume(0) |
|
|
|
|
|
|
|
musicPause:setVolume(0) |
|
|
|
|
|
|
|
end |
|
|
|
elseif PAUSE_POS == 1 then |
|
|
|
elseif PAUSE_POS == 1 then |
|
|
|
_G.GAMESTATE = "MENU" |
|
|
|
_G.GAMESTATE = "MENU" |
|
|
|
print("STATE CHANEGD: MENU!") |
|
|
|
--print("STATE CHANEGD: MENU!") |
|
|
|
_G.PAUSED = false |
|
|
|
_G.PAUSED = false |
|
|
|
musicPause:stop() |
|
|
|
musicPause:stop() |
|
|
|
musicBattle:stop() |
|
|
|
musicBattle:stop() |
|
|
|