main
Simon Kellet 4 months ago
parent ebf9369ba5
commit 7da12d3035
  1. 26
      Game/GameKeyPressed.lua

@ -1,10 +1,15 @@
function GameKeyPressed(key) function GameKeyPressed(key)
if key == "escape" then if key == "escape" then
if not MUTED then
musicBattle:setVolume(0) musicBattle:setVolume(0)
musicPause:setVolume(0.6) musicPause:setVolume(0.6)
else
musicBattle:setVolume(0)
musicPause:setVolume(0)
end
_G.GAMESTATE = "PAUSE" _G.GAMESTATE = "PAUSE"
print("STATE CHANEGD: PAUSED!") --print("STATE CHANEGD: PAUSED!")
_G.PAUSED = true _G.PAUSED = true
end end
@ -12,19 +17,25 @@ function GameKeyPressed(key)
DebugFlag = not DebugFlag DebugFlag = not DebugFlag
end end
--TODO: Better restart
if key == "r" and not _G.PAUSED then if key == "r" and not _G.PAUSED then
RestartGame() RestartGame()
_G.GAMESTATE = "GAME" _G.GAMESTATE = "GAME"
love.load() love.load()
end end
-- debug map changes! if key == "m" then
--[[ MUTED = not MUTED
-- Need to set the battle music to mute
if MUTED then
musicBattle:setVolume(0)
else
musicBattle:setVolume(0.5)
end
end
if DebugFlag and key == "1" then if DebugFlag and key == "1" then
_G.CUR_LEVEL = 1 UserPlayer1.speed = 50000
RestartGame() print("player1 speed increased!")
love.load()
end end
if DebugFlag and key == "2" then if DebugFlag and key == "2" then
_G.CUR_LEVEL = 2 _G.CUR_LEVEL = 2
@ -36,5 +47,4 @@ function GameKeyPressed(key)
RestartGame() RestartGame()
love.load() love.load()
end end
--]]
end end

Loading…
Cancel
Save