Everything worked properly last time I tested while ago. The problem is with the overlay, because when resuming the game the overlay stays there even calling the hideOverlay function…
This is the function where the pause overlay is called:
function scene:pause(event) ... if event.isPause then local options = { effect = "fade", time = 400, isModal = true, params = { currentStage = scene.stage, currentLevel = scene.level } } storyboard.showOverlay("pause", options) end ... end
And this is a simplification of the pause scene:
local storyboard = require "storyboard" local scene = storyboard.newScene() ... function scene.onTouch(event) if event.phase == "release" then if event.id == "Resume" then local fadeTime = 400 storyboard.hideOverlay("fade", fadeTime) elseif event.id == "Menu" then local options = { effect = SCENE\_TRANSITION\_EFFECT, time = SCENE\_TRANSITION\_TIME, params = { stage = mCurrentStage, level = mCurrentLevel, resume = false } } storyboard.gotoScene("menu.menu", options) ... end end end function scene:createScene( event ) ... end scene:addEventListener("createScene", scene) return scene
The thing is I’ve the same code in another old project and works like a charm