How to make a boss key
Posted: Fri Nov 25, 2011 11:54 am
You know what I mean. When you hit it, game sounds stop instantly and the game vanishes from your screen. Not necessary to display the old bogus spreadsheet: your desktop, apart from the love2d game, looks absolutely kosher, surely.
Hitting your window manager's iconify button hides the screen, but that is not much use if the Klingons can still be heard firing nonstop on the earphones that you are forced to take off. Attempting two actions is futile. Your boss key must do everything.
I do this:
Only problem is, restoring is tricky. it's quite hard to give the game focus so it can respond to that 'r'.
But surely this is a solved problem? Many existing games must have the feature?
Hitting your window manager's iconify button hides the screen, but that is not much use if the Klingons can still be heard firing nonstop on the earphones that you are forced to take off. Attempting two actions is futile. Your boss key must do everything.
I do this:
Code: Select all
function love.keypressed(key)
if key=='q' then love.audio.setVolume(0); love.graphics.setMode(1,1) end
if key=='r' then love.audio.setVolume(1); love.graphics.setMode(800,600) end
end
But surely this is a solved problem? Many existing games must have the feature?