Scenes are definitely the way to accomplish this. Using Storyboard, you’d purge your game scene every time you returned to the menu. Like this, for example:
function scene:enterScene(event)
storyboard.purgeScene("game")
end
Then in you game scene, put all your object creation, initializations, and variable resets into the createScene function.
If you want on relaunch specifically, then add a listener that switches the scene as necessary and purges the game scene on each resume. This isn’t usually the best way to go though, per se.
[code]
local function onAppState(event)
if (event.type == “applicationResume”) then
storyboard.gotoScene(“menu”)
storyboard.purgeScene(“game”)
end
end
Runtime:addEventListener(“system”, onAppState)
[/code] [import]uid: 87138 topic_id: 22493 reply_id: 89712[/import]