I'm having a weird error on android.
My escape key is mapped to gameOver( "skip" ), and it works perfectly fine on PC.
Since the back key on android is mapped to the escape key it should work just the same, but unfortunately it doesn't...
If I press back on my android device while in game, the function seems to be partially triggered.
Code: Select all
function gameOver( arg, stage, completed )
love.update = updateMenu
stageNotStarted = true
keys = {
escape = function()
love.graphics.reset()
love.audio.stop()
stageDraw = titleScreen.drawStage
speed = titleScreen.speed
t=0
if stage=="tutorial" then
setKeys( titleScreen.mainMenuKeys )
isTutorial = nil
love.touchpressed = titleScreen.mainMenuTouchpressed
else
setKeys( titleScreen.chooseStageKeys )
love.touchpressed = titleScreen.chooseStageTouchpressed
end
end,
}
keys["return"] = function() keys.escape(); initStage( stage ) end
keys[" "] = function() keys.escape(); initStage( stage ) end
love.touchpressed = function( id, x, y )
if x>((w-h)/2)/w and x<((w+h)/2)/w then
keys["return"]()
end
end
if arg=="skip" then
keys.escape()
else
stageDraw = createGameOverScreen( completed )
end
newRecord = nil
end
Code: Select all
love.graphics.reset() -- doesn't get triggered
love.audio.stop() -- doesn't get triggered
stageDraw = titleScreen.drawStage -- does work
Another very strange thing though is, that this only seems to happen when I first press the back key after launch.
If I enter the stage again and repeat the process, everything seems to work fine.
This problem occurs with a galaxy s2 and a nexus 7.
The error is most probably mine, but I can't seem to find it, and I'd be happy if someone could help me...
If my explaination is insuffcient please tell me so, I will try to specify.
Thanks in advance!