You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
love2d-tank/Game/GameKeyPressed.lua

41 lines
691 B

function GameKeyPressed(key)
7 months ago
if key == "escape" then
4 months ago
musicBattle:setVolume(0)
musicPause:setVolume(0.6)
_G.GAMESTATE = "PAUSE"
print("STATE CHANEGD: PAUSED!")
_G.PAUSED = true
7 months ago
end
if key == "b" and not _G.PAUSED then
7 months ago
DebugFlag = not DebugFlag
end
4 months ago
--TODO: Better restart
if key == "r" and not _G.PAUSED then
4 months ago
RestartGame()
_G.GAMESTATE = "GAME"
7 months ago
love.load()
end
4 months ago
-- debug map changes!
4 months ago
--[[
4 months ago
if DebugFlag and key == "1" then
_G.CUR_LEVEL = 1
RestartGame()
love.load()
end
if DebugFlag and key == "2" then
_G.CUR_LEVEL = 2
RestartGame()
love.load()
end
4 months ago
if DebugFlag and key == "3" then
_G.CUR_LEVEL = 3
RestartGame()
love.load()
end
--]]
7 months ago
end