Corona crashes on scene transition

Hi

hope someone can help me… I use for scene transition FADE in my game, but as soon as I have change it to fromLeft or slideLeft, Corona crashes. Any ideas?

My second problem is with TableView. As I press a row in the table it takes me to the next scene. But  there I had to delete the purgeScene() method since it produced an erorr.

Thank you for the effort

What error(s) are you getting?

If I use storyboard.scenePurge(“scene2”) then I get this error:

Runtime error

?:0: attempt to perform arithmetic on field ‘contentHeight’ (a nil value)

stack traceback:

        [C]: ?

        ?: in function ‘_manageRowLifeCycle’

        ?: in function <?:365>

        ?: in function <?:218>

Now, as I have restarted my computer, corona doesn’t crash anymore, if I use scene transition slideLeft for instance. But I don’t see the chosen effect at all. 

Are you building your scene in the createScene() function or the enterScene() function?

Most game elements I draw in createScene(). All the functions are in enterScene().

Maybe post some code?  Where are you trying to purge scene2?  Is scene2 what you’re transitioning on screen?

Yes, I’m trying to purge scene 2 as I select the level. This is then done on scene 3.

The structure is like this:

scene1 = welcome screen

–>

scene2 = level selection

–>

scene3 = game

Here is also the code from  scene2:

-- Called when the scene's view does not exist: function scene:createScene( event ) local screenGroup = self.view --BEGIN SQLITE require "sqlite3" --Open data.db. If the file doesn't exist it will be created local path = system.pathForFile("mydata.db", system.DocumentsDirectory) --local path = system.pathForFile("mydata.db", system.ResourceDirectory) db = sqlite3.open( path ) --Handle the applicationExit event to close the db local function onSystemEvent( event ) if( event.type == "applicationExit" ) then db:close() end end --setup the system listener to catch applicationExit Runtime:addEventListener( "system", onSystemEvent ) --END SQLITE end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) local screenGroup = self.view -- remove previous scene's view storyboard.purgeScene( "scene1" ) local widget = require( "widget" ) local backGround1 = display.newRect(screenGroup, 0,0,width,height) backGround1:setFillColor(78,132,132) local backGround2 = display.newRect(screenGroup, 25,25,width-50,height-50) backGround2:setFillColor(255,250,229) text1 = display.newText( "Choose your route:", 0, 0, native.systemFontBold, 35 ) text1:setTextColor( 90 ) text1:setReferencePoint( display.CenterReferencePoint ) text1.x, text1.y = display.contentWidth \* 0.5, 100 screenGroup:insert( text1 ) local dbRec = {} local idx = 0 ------------------------------------------------ -- TABLE STUFF ------------------------------------------------ -- Listen for tableView events local function tableViewListener( event ) local phase = event.phase local row = event.target end local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num \* mult + 0.5) / mult end local function percentage(tH, s, rH ) local obj if ( tH ~= 0 ) and ( s == 0 ) then obj = round((height-tH)/rH\*100) elseif ( s == 1 ) then obj = 100 else obj = 0 end return obj end -- Handle row rendering local function onRowRender( event ) local phase = event.phase local row = event.row local climbedStatus if ( dbRec[row.index].status == 1) then climbedStatus = "images/green.png" else climbedStatus = "images/red.png" end local rowTitle = display.newText( row, dbRec[row.index].routeName, 0, 0, nil, 30 ) rowTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( rowTitle.contentWidth \* 0.5 ) + 5 rowTitle.y = row.contentHeight \* 0.5 rowTitle:setTextColor( 0, 0, 0 ) local subTitle = display.newText( row, "Route: "..percentage( dbRec[idx].topHeight, dbRec[idx].status, dbRec[idx].routeH ).."%", 0, 0, nil, 14 ) subTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( subTitle.contentWidth \* 0.5 ) + 5 subTitle.y = row.contentHeight \* 0.5 + 24 subTitle:setTextColor( 0, 0, 0 ) local arrow = display.newImage( row, "images/rowArrow.png") arrow.x = width -75 arrow.y = row.contentHeight \* 0.5 local arrow = display.newImage( row,climbedStatus) arrow.x = width -100 arrow.y = row.contentHeight \* 0.5 end -- Handle touches on the row local function onRowTouch( event ) local phase = event.phase if "press" == phase then storyboard.state.routeId = dbRec[event.target.index].routeId storyboard.gotoScene( "scene3","slideLeft", 200) return true end end -- Create a tableView local tableView = widget.newTableView { top = 80, left = 25, width = width-55, height = height - 150, backgroundColor = { 255,250,229 }, --maskFile = "assets/mask-320x366.png", listener = tableViewListener, onRowRender = onRowRender, onRowTouch = onRowTouch, } screenGroup:insert( tableView ) --print all the table contents for row in db:nrows("SELECT \* FROM main WHERE difficulty=1 ORDER BY status") do idx = idx + 1 dbRec[idx] = {} dbRec[idx].routeId = row.route\_id dbRec[idx].routeName = row.route\_name dbRec[idx].difficulty = row.difficulty dbRec[idx].status = row.status dbRec[idx].topHeight = row.topHeight dbRec[idx].routeH = row.height local isCategory = false local rowHeight = 75 local rowColor = { default = { 255,250,229 }, over = { 211, 211, 204 }, } local lineColor = { 220, 220, 220 } tableView:insertRow { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, } end --MENU-------------------------------------- local backGround3 = display.newRect(screenGroup, 0,0,width,75) backGround3:setFillColor(78,132,132) -- create a shadow underneath the titlebar (for a nice touch) local shadow = display.newImage(screenGroup, "images/shadow.png" ) shadow:setReferencePoint( display.TopLeftReferencePoint ) shadow.x, shadow.y = 25, 75 shadow.xScale = (width - 50 )/ shadow.contentWidth shadow.alpha = 0.45 easy = display.newImage (screenGroup, "images/menu\_easy\_s.png", 40, 15) medium = display.newImage (screenGroup, "images/menu\_medium.png", (width/2)-60, 15) hard = display.newImage (screenGroup, "images/menu\_hard.png", width-120, 15) local filter = require("scene\_transition") easy.touch = filter.onSceneEasy easy:addEventListener( "touch", easy ) medium.touch = filter.onSceneMedium medium:addEventListener( "touch", medium ) hard.touch = filter.onSceneHard hard:addEventListener( "touch", hard ) -------------------------------------- local bottomGround3 = display.newRect(screenGroup, 0,height-50,width,50) bottomGround3:setFillColor(78,132,132) end

All of your scene’s visuals are in enterScene(), not createScene().  The way storyboard transitions work is that the createScene() function builds the screen offscreen and when it’s done, it’s transitioned on screen, then enterScene() is called.  By having all of your display.newImage() things (and other graphical bits) in enterScene, you have nothing being drawn in createScene to transition on screen.

Oh sorry I have been a bit confusing. The code posted before is from scene2. And as I go from scene2 to scene3 there is the problem. No scene transition there. Also in scene3 I am drawing the level and player under createScene(). My game logic is then in enterScene().

Also if I put in scene3 purgeScene(“scene2”) then I get the error from my posts above.

can you post your scene3 code?

While transitioning to scene3 I get also this error:

ERROR: physics.start() has not been called.

Could this be the reason?

Here is some code, scene3 has more than 1400 lines. :frowning:

--------------------------------------------------------------------------------- -- -- scene3.lua -- --------------------------------------------------------------------------------- local storyboard = require( "storyboard" ) local scene = storyboard.newScene() --------------------------------------------------------------------------------- -- THE GAME --------------------------------------------------------------------------------- local height = display.contentHeight local width = display.contentWidth local xOffset, yOffset = 0, 0 local menuTip = display.newGroup() -- Tips content local tipEnergyLeft, tipEnergyRight, tipMenu local armTopL, armTopR, armBottomL, armBottomR, handL, handR, head, torso1, torso2, torso3, torso4, torso5, torso6, legTopL, legTopR, legBottomL, legBottomR, footL, footR local wallBottom, backGround, numberGrips local leftValue, rightValue local allElements = display.newGroup() local energy = display.newGroup() local grip = {} local button1, button2, button3, button4 local energyLimitText local myGameSettings local description = "" local function setFill(obj, param) obj:setFillColor(param[1], param[2], param[3], param[4] or 255) end local colorShirt = {251, 74, 74, 255} local colorSkin = {249, 203, 138, 255} local colorPants = {22, 127, 134, 255} local energyBar = { 78,132,132, 255} --SAVE GAME DATA local jsonCopy = require("jsonCopy") -- Called when the scene's view does not exist: function scene:createScene( event ) local group = self.view local physics = require( "physics" ) physics.setContinuous( false ) physics.setScale( 60 ) physics.start() --physics.setDrawMode( "hybrid" ) --COLLISION FILTERS buttonCollisionFilter1 = { categoryBits = 1, maskBits = 1 } -- left arm, right leg buttonCollisionFilter2 = { categoryBits = 2, maskBits = 2 } -- left leg, right arm leftLegCollisionFilter = { categoryBits = 4, maskBits = 36 } rightLegCollisionFilter = { categoryBits = 8, maskBits = 40 } climberCollisionFilter = { categoryBits = 16, maskBits = 48 } borderCollisionFilter = { categoryBits = 32, maskBits = 252 } leftArmCollisionFilter = { categoryBits = 64, maskBits = 96 } rightArmCollisionFilter = { categoryBits = 128, maskBits = 160 } limitFeetCollisionFilter = { categoryBits = 256, maskBits = 256 } hairCollisionFilter = { groupIndex = -2, categoryBits = 512, maskBits = 512 } routeId = storyboard.state.routeId myGameSettings = jsonCopy.loadTable("mygamesettings.json") local wrapText = require( "text" ) --SQLITE --get main route data for row in db:nrows("SELECT \* FROM main WHERE route\_id = " .. routeId) do routeW = row.width routeH = row.height routeName = row.route\_name description = row.description topHeight = row.topHeight difficulty = row.difficulty climbedStatus = row.climbed\_status count = row.count end myGameSettings.lastLevel = difficulty count = count + 1 local kl = ("UPDATE main SET count="..count .. " WHERE route\_id=" .. routeId) db:exec( kl ) local backGround2 = display.newRect(menuTip, 0,0,width,height) backGround2:setFillColor(255,250,229) backGround = display.newRect(0,(height-routeH),routeW,routeH) --backGround:setFillColor(255,250,229) backGround.alpha = 0 backGround.isHitTestable = true local function getWidth() local trueWidth if (routeW \> width) then trueWidth = routeW else trueWidth = width end return trueWidth end local heightLimit = display.newLine( allElements, 0,topHeight, getWidth(), topHeight ) heightLimit:setColor( 200, 200, 200 ) heightLimit.width = 2 local heightLimitText = display.newText (allElements, "MAX HEIGHT", width/2, topHeight, native.systemFont, 20) heightLimitText:setTextColor( 200, 200, 200 ) if (topHeight == 0) or (climbedStatus == 1) then heightLimit.isVisible = false heightLimitText.isVisible = false end ...

It could be.  I notice that you are requiruring physics inside createScene and making it local to createScene.  This will prevent you from accessing physics in other functions.  You should move that to the top of the scene file.

Also, generally with storyboard, you want to have things that kickoff movement delayed until enterScene().  I would move your physics.start() call there. 

Now for the error, are you using widgets like a widget.newTableView() anywhere?

OK, I am now requiring physics on the top, also I have moved all physics functions(addbody, addjoints) to enterScene. Unfortunatly no succes. I am pasting bellow the whole code for createScene, nothing special in it.

function scene:createScene( event ) local group = self.view --COLLISION FILTERS buttonCollisionFilter1 = { categoryBits = 1, maskBits = 1 } buttonCollisionFilter2 = { categoryBits = 2, maskBits = 2 } leftLegCollisionFilter = { categoryBits = 4, maskBits = 36 } rightLegCollisionFilter = { categoryBits = 8, maskBits = 40 } climberCollisionFilter = { categoryBits = 16, maskBits = 48 } borderCollisionFilter = { categoryBits = 32, maskBits = 252 } leftArmCollisionFilter = { categoryBits = 64, maskBits = 96 } rightArmCollisionFilter = { categoryBits = 128, maskBits = 160 } limitFeetCollisionFilter = { categoryBits = 256, maskBits = 256 } hairCollisionFilter = { groupIndex = -2, categoryBits = 512, maskBits = 512 } routeId = storyboard.state.routeId myGameSettings = jsonCopy.loadTable("mygamesettings.json") local wrapText = require( "text" ) --SQLITE --get main route data for row in db:nrows("SELECT \* FROM main WHERE route\_id = " .. routeId) do routeW = row.width routeH = row.height routeName = row.route\_name description = row.description topHeight = row.topHeight difficulty = row.difficulty status = row.status count = row.count end myGameSettings.lastLevel = difficulty count = count + 1 local kl = ("UPDATE main SET count="..count .. " WHERE route\_id=" .. routeId) db:exec( kl ) if (routeW \> width) then startX = (width - routeW)/2 else startX = 0 end local backGround2 = display.newRect(menuTip, 0,0,width,height) backGround2:setFillColor(255,250,229) backGround = display.newRect( startX,(height-routeH),routeW,routeH) backGround.alpha = 0 backGround.isHitTestable = true local heightLimit = display.newLine( allElements, startX,topHeight, getWidth(), topHeight ) heightLimit:setColor( 200, 200, 200 ) heightLimit.width = 2 energyLimitText = display.newText (menuTip, "TRY TO REST!", width/2-120, height/2, native.systemFontBold, 35) energyLimitText:setTextColor( 200, 200, 200 ) energyLimitText.isVisible = false local heightLimitText = display.newText (allElements, "MAX HEIGHT", width/2, topHeight, native.systemFont, 20) heightLimitText:setTextColor( 200, 200, 200 ) if (topHeight == 0) or (status == 1) then heightLimit.isVisible = false heightLimitText.isVisible = false end --GRIFI local level = require("routes.route"..routeId) numberGrips = level.countT() for row in db:nrows("SELECT \* FROM route WHERE route\_id = " .. routeId) do local gripX = row.grip\_location\_x local gripY = row.grip\_location\_y local gripType = row.grip\_type end local function createGrips() local originX = width/2 local originY = height -75 --they begin from bellow for i=1,numberGrips do local r = (level[i][3]) local x = originX + level[i][1] local y = originY - level[i][2] if (r == 1) then grip[i] = display.newImage( allElements, "images/grif1.png", x, y ) elseif (r == 2) then grip[i] = display.newImage( allElements, "images/grif2.png", x, y ) elseif (r == 3) then grip[i] = display.newImage( allElements, "images/grif3.png", x, y ) end grip[i].status = "active" grip[i].size = gripSize[r].s end end createGrips() allElements:insert( backGround ) backGround:toBack() local function getGoal() local trueGoal if (routeH \> height) then trueGoal = 75 else trueGoal = 75-routeH+height end return trueGoal end local function getHeight() local trueHeight if (routeH \< height) then trueHeight = 0 else trueHeight = -routeH+height end return trueHeight end local goal = display.newRect(allElements, startX,getHeight(),getWidth(),getGoal()) goal:setFillColor( 255, 205, 5 ) local goalText = display.newText(allElements, "it ends here", 80,height-routeH,native.systemFontBold, 35) goalText:setTextColor(90) tipEnergyLeft = display.newImage( energy, "images/left\_handA.png", 40, 20) tipEnergyRight = display.newImage( energy, "images/right\_handA.png", width-120, 20) tipMenu = display.newImage( menuTip, "images/open\_menuA.png", width - 230, height-45) if myGameSettings.tipsOn then tipEnergyLeft.isVisible = true tipEnergyRight.isVisible = true tipMenu.isVisible = true else tipEnergyLeft.isVisible = false tipEnergyRight.isVisible = false tipMenu.isVisible = false end armTopL = display.newRect(allElements,w-59,h+29,38,8) setFill(armTopL, colorSkin) armTopR = display.newRect(allElements,w+23,h+29,38,8) setFill(armTopR, colorSkin) armBottomL = display.newRect(allElements,w-105,h+29,48,8) setFill(armBottomL, colorSkin) armBottomR = display.newRect(allElements,w+59,h+29,48,8) setFill(armBottomR, colorSkin) handL = display.newCircle(allElements,w-115,h+29,r) handR = display.newCircle(allElements,w+117,h+29,r) setFill(handL, colorSkin) setFill(handR, colorSkin) head = display.newCircle(allElements,w,h-2,20) head:setFillColor(50,50,50) torso1 = display.newRect(allElements,w-23,h+20,46,18) setFill(torso1, colorShirt) torso2 = display.newRect(allElements,w-20,h+36,40,18) setFill(torso2, colorShirt) torso3 = display.newRect(allElements,w-17,h+52,34,18) setFill(torso3, colorShirt) torso4 = display.newRect(allElements,w-14,h+68,28,12) setFill(torso4, colorShirt) torso5 = display.newRect(allElements,w-16,h+78,32,16) setFill(torso5, colorShirt) torso6 = display.newRect(allElements,w-18,h+92,36,16) setFill(torso6, colorPants) legTopL = display.newRect(allElements,w-18,h+106,16,58) setFill(legTopL, colorPants) legTopR = display.newRect(allElements,w+2,h+106,16,58) setFill(legTopR, colorPants) legBottomL = display.newRect(allElements,w-15,h+162,10,68) setFill(legBottomL, colorSkin) legBottomR = display.newRect(allElements,w+5,h+162,10,68) setFill(legBottomR, colorSkin) footL = display.newImage(allElements,"images/footL.png", w-34,h+228) footR = display.newImage(allElements,"images/footR.png",w+3,h+228) bag = display.newRect(allElements,w-10,h+92,20,30) bag:setFillColor(50,50,50) head:toFront() -- BUTTONS local buttonRadius = 35 button1 = display.newCircle(allElements,(footL.x-4),(footL.y),buttonRadius) button1.myName = "footL" button2 = display.newCircle(allElements,(footR.x+4),(footR.y),buttonRadius) button2.myName = "footR" button3 = display.newCircle(allElements,(handL.x),(handL.y),buttonRadius) button3.myName = "handL" button4 = display.newCircle(allElements,(handR.x),(handR.y),buttonRadius) button4.myName = "handR" end

To the error. widget.newTableVIew() is being used in scene2. There the player is selecting his level. 

What error(s) are you getting?

If I use storyboard.scenePurge(“scene2”) then I get this error:

Runtime error

?:0: attempt to perform arithmetic on field ‘contentHeight’ (a nil value)

stack traceback:

        [C]: ?

        ?: in function ‘_manageRowLifeCycle’

        ?: in function <?:365>

        ?: in function <?:218>

Now, as I have restarted my computer, corona doesn’t crash anymore, if I use scene transition slideLeft for instance. But I don’t see the chosen effect at all. 

Are you building your scene in the createScene() function or the enterScene() function?

Most game elements I draw in createScene(). All the functions are in enterScene().

Maybe post some code?  Where are you trying to purge scene2?  Is scene2 what you’re transitioning on screen?

Yes, I’m trying to purge scene 2 as I select the level. This is then done on scene 3.

The structure is like this:

scene1 = welcome screen

–>

scene2 = level selection

–>

scene3 = game

Here is also the code from  scene2:

-- Called when the scene's view does not exist: function scene:createScene( event ) local screenGroup = self.view --BEGIN SQLITE require "sqlite3" --Open data.db. If the file doesn't exist it will be created local path = system.pathForFile("mydata.db", system.DocumentsDirectory) --local path = system.pathForFile("mydata.db", system.ResourceDirectory) db = sqlite3.open( path ) --Handle the applicationExit event to close the db local function onSystemEvent( event ) if( event.type == "applicationExit" ) then db:close() end end --setup the system listener to catch applicationExit Runtime:addEventListener( "system", onSystemEvent ) --END SQLITE end -- Called immediately after scene has moved onscreen: function scene:enterScene( event ) local screenGroup = self.view -- remove previous scene's view storyboard.purgeScene( "scene1" ) local widget = require( "widget" ) local backGround1 = display.newRect(screenGroup, 0,0,width,height) backGround1:setFillColor(78,132,132) local backGround2 = display.newRect(screenGroup, 25,25,width-50,height-50) backGround2:setFillColor(255,250,229) text1 = display.newText( "Choose your route:", 0, 0, native.systemFontBold, 35 ) text1:setTextColor( 90 ) text1:setReferencePoint( display.CenterReferencePoint ) text1.x, text1.y = display.contentWidth \* 0.5, 100 screenGroup:insert( text1 ) local dbRec = {} local idx = 0 ------------------------------------------------ -- TABLE STUFF ------------------------------------------------ -- Listen for tableView events local function tableViewListener( event ) local phase = event.phase local row = event.target end local function round(num, idp) local mult = 10^(idp or 0) return math.floor(num \* mult + 0.5) / mult end local function percentage(tH, s, rH ) local obj if ( tH ~= 0 ) and ( s == 0 ) then obj = round((height-tH)/rH\*100) elseif ( s == 1 ) then obj = 100 else obj = 0 end return obj end -- Handle row rendering local function onRowRender( event ) local phase = event.phase local row = event.row local climbedStatus if ( dbRec[row.index].status == 1) then climbedStatus = "images/green.png" else climbedStatus = "images/red.png" end local rowTitle = display.newText( row, dbRec[row.index].routeName, 0, 0, nil, 30 ) rowTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( rowTitle.contentWidth \* 0.5 ) + 5 rowTitle.y = row.contentHeight \* 0.5 rowTitle:setTextColor( 0, 0, 0 ) local subTitle = display.newText( row, "Route: "..percentage( dbRec[idx].topHeight, dbRec[idx].status, dbRec[idx].routeH ).."%", 0, 0, nil, 14 ) subTitle.x = row.x - ( row.contentWidth \* 0.5 ) + ( subTitle.contentWidth \* 0.5 ) + 5 subTitle.y = row.contentHeight \* 0.5 + 24 subTitle:setTextColor( 0, 0, 0 ) local arrow = display.newImage( row, "images/rowArrow.png") arrow.x = width -75 arrow.y = row.contentHeight \* 0.5 local arrow = display.newImage( row,climbedStatus) arrow.x = width -100 arrow.y = row.contentHeight \* 0.5 end -- Handle touches on the row local function onRowTouch( event ) local phase = event.phase if "press" == phase then storyboard.state.routeId = dbRec[event.target.index].routeId storyboard.gotoScene( "scene3","slideLeft", 200) return true end end -- Create a tableView local tableView = widget.newTableView { top = 80, left = 25, width = width-55, height = height - 150, backgroundColor = { 255,250,229 }, --maskFile = "assets/mask-320x366.png", listener = tableViewListener, onRowRender = onRowRender, onRowTouch = onRowTouch, } screenGroup:insert( tableView ) --print all the table contents for row in db:nrows("SELECT \* FROM main WHERE difficulty=1 ORDER BY status") do idx = idx + 1 dbRec[idx] = {} dbRec[idx].routeId = row.route\_id dbRec[idx].routeName = row.route\_name dbRec[idx].difficulty = row.difficulty dbRec[idx].status = row.status dbRec[idx].topHeight = row.topHeight dbRec[idx].routeH = row.height local isCategory = false local rowHeight = 75 local rowColor = { default = { 255,250,229 }, over = { 211, 211, 204 }, } local lineColor = { 220, 220, 220 } tableView:insertRow { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, } end --MENU-------------------------------------- local backGround3 = display.newRect(screenGroup, 0,0,width,75) backGround3:setFillColor(78,132,132) -- create a shadow underneath the titlebar (for a nice touch) local shadow = display.newImage(screenGroup, "images/shadow.png" ) shadow:setReferencePoint( display.TopLeftReferencePoint ) shadow.x, shadow.y = 25, 75 shadow.xScale = (width - 50 )/ shadow.contentWidth shadow.alpha = 0.45 easy = display.newImage (screenGroup, "images/menu\_easy\_s.png", 40, 15) medium = display.newImage (screenGroup, "images/menu\_medium.png", (width/2)-60, 15) hard = display.newImage (screenGroup, "images/menu\_hard.png", width-120, 15) local filter = require("scene\_transition") easy.touch = filter.onSceneEasy easy:addEventListener( "touch", easy ) medium.touch = filter.onSceneMedium medium:addEventListener( "touch", medium ) hard.touch = filter.onSceneHard hard:addEventListener( "touch", hard ) -------------------------------------- local bottomGround3 = display.newRect(screenGroup, 0,height-50,width,50) bottomGround3:setFillColor(78,132,132) end

All of your scene’s visuals are in enterScene(), not createScene().  The way storyboard transitions work is that the createScene() function builds the screen offscreen and when it’s done, it’s transitioned on screen, then enterScene() is called.  By having all of your display.newImage() things (and other graphical bits) in enterScene, you have nothing being drawn in createScene to transition on screen.