Hi all
I finally moved from “Debug Build” to “Release Build” and I found that both builds do not behave the same.
I found that the “Back” key in the Release build don’t behave as expected and it is not stable.
In my design I use the “back” key to enter the Pause overlay during the game or to go back to a specific scene (not during the game, for example from “select-level” to “menu”)
In “Debug Build” all the transition between scenes on my phone work perfectly, but when I created a “Release Build” this is no longer the case.
During the game the “Back” key don’t show the “Pause” overlay, and not during the game the “Back” key sometimes working and sometimes not, sometimes it exit completely from the game.
Code in the game scene
local function onKeyEvent( event )
local phase = event.phase
local keyName = event.keyName
if ( “back” == keyName and phase == “up” and overlayOn == 0) then
physics.pause ()
if (tmr ~= nil) then
timer.pause(tmr);
end
if blinkTimer then
timer.pause(blinkTimer)
end
if emptyBoxTimer then
timer.pause(emptyBoxTimer)
end
local options =
{
isModal = true,
effect = “fromTop”,
time = 500,
}
composer.showOverlay( “exitOverlay”, options )
overlayOn = 1
return true
end
return false
end
Code in levelselect scene
local function onKeyEvent( event )
local phase = event.phase
local keyName = event.keyName
if ( “back” == keyName and phase == “up” ) then
composer.gotoScene(“menu”, { effect = “crossFade”, time = 333, isModal = true })
return true
end
return false
end
I also try to remove the ‘return false’ and I receive the same results
Any ideas?
Regards,
Gu