i do something similar for a “redo” button, in rough pseudocode…
– PlayScene.lua
local function onRedoPress(e)
storyboard.gotoScene(“RedoScene”)
– you don’t want to just call storyboard.gotoScene(“PlayScene”) here
– as your exit/enter’s can get mixed up if you try coming and going to/from same scene at once
end
– RedoScene.lua
– essentially a do-nothing scene
– as soon as we get here we head right back to PlayScene
– but in the mean time PlayScene has had a chance to fully exit
function scene:onEnterScene()
– you can safely purge/remove here (if you need to) prior to reentering PlayScene…
– for my use (redo) i just wanted to launch it up again fresh from the start…
storyboard.gotoScene(“PlayScene”)
end