“main” relevant lines:
storyboard = require "storyboard"
storyboard.purgeOnSceneChange = true
storyboard.gotoScene( "game" )
“game” relevant lines and structure:
local function restart()
storyboard.gotoScene( "transition", {effect = "crossFade",time = 250} )
end
function scene:createScene( event )
physics = require "physics"
physics.start(); physics.pause()
local group = self.view
group:insert( self.particleManager:getGroup() )
group:insert( self.scoreText )
group:insert( self.bestScoreText )
group:insert ( scene.statBoard )
end
function onCollision(event)
--Do a bunch of thing if stuff collides
end
function scene:enterScene( event )
local group = self.view
--Reset some unrelated variables
Runtime:addEventListener( "enterFrame", loop )
Runtime:addEventListener( "collision", onCollision )
end
function scene:exitScene( event )
local group = self.view
physics.stop()
Runtime:removeEventListener( "enterFrame", loop )
Runtime:removeEventListener( "collision", onCollision )
end
function scene:destroyScene( event )
local group = self.view
--Remove some display objects and set them to nil
package.loaded[physics] = nil
physics = nil
end
scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )
return scene
“transition” structure:
local scene = storyboard.newScene()
function scene:createScene( event )
local group = self.view
end
function scene:enterScene( event )
end
function scene:exitScene( event ) end
function scene:destroyScene( event ) end
scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )
return scene
The problem happens once that “restart” function runs… but a completely different code using the same logistics is also triggering that error.
PS: It won’t even run any of the create or enter scene listeners of the “transition” file [import]uid: 151732 topic_id: 35650 reply_id: 141784[/import]