how would i change to omposer

ok someone told me that storyboard isn’t being supported anymore and told me i should change to composer. ok i wrote all my codes in storyboard, how would i go about changing it with out affecting my files or changing my design. because im still very new and i dont even still know what the difference between the two are and i was wondering if you could look at my files and tell me what i should do to change them to make them work as a composer or should i just leave it as story board.  also could you tell me if im doing any of this wrong.

main.lua file

[lua]

 display.setStatusBar( display.HiddenStatusBar )

     

    splashScreen = display.newImage(“Default-568h@2x.png”)

    splashScreen.anchorX = 0; splashScreen.anchorY = 0;

     

    – Storyboard

    local storyboard = require “storyboard”

    storyboard.purgeOnSceneChange = true

     

    storyboard.gotoScene(“splash”)

local loadSave = require “loadsave”

if loadSave.loadTable(“mySaveTable.json”) == nil then

    local mySaveTable = {}

    mySaveTable.cardIndex = 1

    loadSave.saveTable(mySaveTable, “mySaveTable.json”)

end

[/lua]

splashscreen.lua

[lua]

local storyboard = require(“storyboard”)

    local scene = storyboard.newScene()

local splashscreen = display.newImage( “zzdirectionquestions.jpg” );

splashscreen.width, splashscreen.height = display.contentWidth, display.contentHeight

    splashscreen.x, splashscreen.y = display.contentWidth / 2, display.contentHeight / 2

    splashscreen:scale(1.0, .5)

     

     

    local function removeSplash(event)

    splashscreen:removeSelf()

    splashscreen = nil

    end 

    timer.performWithDelay(1900,removeSplash)

     

     

    local text2 = display.newText( “loading…”, 150, 250, native.systemFont, 16 )

    text2.x = 165

    text2.y = 250

    text2:setFillColor(0,0,0)

     

          

    local function removetext2(event)

text2:removeSelf()

text2 = nil

    end 

    timer.performWithDelay(1000,removetext2)

     

     

     

     

    function scene:createScene(event)

local gameGroup = self.view

_W = display.contentWidth*0.5;

_H = display.contentHeight*0.5;

local background = display.newRect(0,0, display.contentWidth, display.contentHeight)

background.x = _W; background.y = _H;

local text = display.newText( “Continue”, 100, 500, native.systemFont, 20 )

text.x = _W; text.y = _H;

text:setFillColor(0,0,0)

gameGroup:insert(text)

function touchEvent(event)

if event.phase == “ended” then

storyboard.gotoScene(“menuscreen”)

end

end

     

     

text:addEventListener(“touch”, touchEvent)

gameGroup:insert(background)

gameGroup:insert(splashscreen)

gameGroup:insert(text)

gameGroup:insert(text2)

splashscreen:toFront()

text2:toFront()

    end

     

    function scene:enterScene(event)

    end

     

    function scene:exitScene(event)

    end

     

    scene:addEventListener(“createScene”, scene)

    scene:addEventListener(“enterScene”, scene)

    scene:addEventListener(“exitScene”, scene)

    scene:addEventListener(“destroyScene”, scene)

    return scene

[/lua]

menuscreen.lua

[lua]

local storyboard = require(“storyboard”)

    local scene = storyboard.newScene()

     

       

    function scene:createScene(event)

    

        local gameGroup = self.view

        

        

        local background = display.newImage(“zzfirequestion.jpg”,0,0, display.contentWidth, display.contentHeight)

        background.x = 160

        background.y = 240

        

           

        local continueb = display.newText( “>Continue”, 150, 250, native.systemFontBold, 20 )

        continueb.x = 165

        continueb.y = 200

        continueb:setFillColor( 1.0, 0., 0.0 )

        continueb:scale(.90,.90)

        

              

        local resetb = display.newText( “Reset”, 150, 250, native.systemFont, 25 )

        resetb.x = 165

        resetb.y = 250

        resetb:setFillColor( 0.0, 0.9, 0.0 )

        resetb:scale(.90,.90)

        

        

        local aboutb = display.newText( “About”, 150, 250, native.systemFont, 25)

        aboutb.x = 165

        aboutb.y = 300

        aboutb:setFillColor( 0.0, 0.6, 0.9 )

        aboutb:scale(.90,.90)

        

        

        local onTap = function(event)

            if event.target == continueb then

              storyboard.gotoScene(“gamescreen”)

            elseif event.target == resetb then

              storyboard.gotoScene(“resetscreen”)

            elseif event.target == aboutb then

              storyboard.gotoScene(“aboutscreen”)

            end

         end

        

         continueb:addEventListener(“tap”, onTap)

         aboutb:addEventListener(“tap”, onTap)

         resetb:addEventListener(“tap”, onTap)

        

        

        gameGroup:insert(background)

        gameGroup:insert(continueb)

        gameGroup:insert(resetb)

        gameGroup:insert(aboutb)

    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

[/lua]

aboutscreen.lua file

[lua]

local storyboard = require(“storyboard”)

    local scene = storyboard.newScene()

    function scene:createScene(event)

         local background = display.newImage(“zzfirequestion.jpg”,0,0, display.contentWidth, display.contentHeight)

        background.x = 160

        background.y = 240

    local gameGroup = self.view

    end

    

    function scene:enterScene(event)

    end

     

          

    function scene:exitScene(event)

    end

     

     

    function scene:destroyScene( event )

    end

     

     

     gameGroup:insert(background)

    

    scene:addEventListener(“createScene”, scene)

    scene:addEventListener(“enterScene”, scene)

    scene:addEventListener(“exitScene”, scene)

    scene:addEventListener(“destroyScene”, scene)

    return scene

end

[/lua]

[lua]

    local storyboard = require(“storyboard”)

    local scene = storyboard.newScene()

    

    local widget = require (“widget”)

     

    

    

    function scene:createScene(event)

        local gameGroup = self.view

        local loadSave = require “loadsave”

    

local mySaveTable = loadSave.loadTable(“mySaveTable.json”)

        

        

       local background = display.newImage(“Default-568h@2x.png”,0,0, display.contentWidth, display.contentHeight)

background.x = 200

background.y = 240

background:scale(.90,1.20)

        

         local function menuTouch(event)

            if event.phase == “ended” then

                storyboard.gotoScene(“menuscreen”)

            end

         end

         local list_of_things_to_say = {  “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”,  “9”, “10”,   “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18”, “19”, “20”  }

-----display text

local options = 

{

    --parent = textGroup,

    text = “Hello”,     

    x = 160,

    y = 200,

    width = 150,     --required for multi-line and alignment

    font = native.systemFontBold,   

    fontSize = 18,

    align = “center”  --new alignment parameter

}

local myText = display.newText( options )

myText:setFillColor( 1, 0, 0 )

– event handler must be defined before creating button with widget.newButton()

 local function onObjectTouch( event )

    if event.phase == “ended” then

        if #list_of_things_to_say > 0 then

             – calculate random index

             local idx = math.random(1, #list_of_things_to_say)

             – set the text property of your text object to the string at given index of list_of_things_to_say

             myText.text = list_of_things_to_say[idx]

            – remove this string from the table so that it cannot be used again

            table.remove(list_of_things_to_say, idx)

        else – if there’s no more things to say

myText.text = “No more things to say”

        end

    end

     return true

end           

----button

local rndmtxt = widget.newButton

{

    left = 160,

    top = 410,

    id = “newQuestionbtn”,

    label = “question me?”,

    onEvent = onObjectTouch

}

     

     

     

         local menu = widget.newButton

            {

               left = -25,

               top = 410,

               id = “menuscreen”,

               label = “menu”,

               onEvent = menuTouch

            }

     

     

    

        gameGroup:insert(background)

        gameGroup:insert(menu)

        gameGroup:insert(rndmtxt)

        gameGroup:insert(myText)

        

    end

     

     

    

    function scene:enterScene(event)

    end

     

    function moveToScene()

    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

[/lua]

  1. it is a good idea to convert to composer.

  2. storyboard and composer are very similar, composer is the new improved version of storyboard, so converting over your code will be easy and fairly quick.

  3. looks like you have maybe 3 or 4 'scene’modules. Most of the code in them you can cut and paste into a new composer files, using composer template.

  4. get the composer ‘scene’ template from here …  https://docs.coronalabs.com/daily/api/library/composer/index.html#template

I had actually type out several paragraphs on how I would go about converting over your code from storyboard to composer … and then realized you are better off ‘not reading my overly wordy explanation’ and doing these 2 things:

  1. How to convert from storyboard to composer is better explained here:

https://docs.coronalabs.com/api/library/composer/migration.html

  1. As you are new to this, I think it is best (just my opinion), rather then just cut and paste old storyboard files to composer files…  it is better to start a new app/project and just ‘re-rtype’ all that code using the composer template in each of the new scene files. You don’t use the template in main.lua

First, read the link above about converting to composer.  I would also try and find 1 or 2 examples/tutorials of a very simple small app that used composer… and go over them.

You can find some samples or tutorials searching the corona forums and the internet.

Good luck… hope this helps a little.

Bob

ok thank you but i decided to follow that guide and its confusing me. i copy pasted the scene template and built on to it, but nothing happens, not even a image, i was also told that all you need in the main.lua file is 3 codes to make it work, i cant seem to find the 3 codes. i have a splash screen that’s so post to start up the min i hit launch. but all i get is a blank screen. i know how to write code just in the main.lua file. but i i need a total of 4 modules/screens/scenes. it should be about 5 or 6 different files. im trying to figure out how to incorporate them together. basically as soon as the app launches i want a 2 second title screen that can be skipped if pressed early, then strait to the menuscreen. menu screen will have 3 buttons. continue/reset/about. at this point im thinking about scratching out the about screen since i cant seem to figure out what should be there. then when you hit continue, it will then take you to the game screen. then obviously when you hit the menu button it takes you back. but i want it to save where you left off. unless when your in the menu screen you can choose to reset the app, it will then reset the app right back  to the beginning. so basically i just need help figuring out what code goes where now. also what do i put in each screen to make it work since i have all storyboard codes.

TL&DR Your last post starting “ok thank you…”  It is all mashed into one long run-on.  Not sure if you typed that on a phone, or just don’t use paragraphs.  I’m only mentioning this because poorly formatted posts get less help because they are hard to read.  I want to help, but honestly don’t have the time to puzzle through confusing and hard to read questions.

Regarding the stated topic of this post:

The Corona Staff have already provided resources to help you with this:

There is nothing we can say here that isn’t already said in the first article and the second link has lots of useful stuff too.  

PS - cyberparkstudios make an excellent point.  Re-write from scratch instead of copy-pasting your code or you new composer files will be a hot-mess and confusing. 

I frequently write a prototype, then re-write it.  This is a great way to learn and to improve.  Well formatted tight code is highly-undervalued.

http://gamasutra.com/blogs/VasileiosKaravasilis/20151005/255286/Refactoring_the_Way_to_Perfection.php

Question: Can you tell us what your background is?  i.e. Programming experience, prior game dev, is English your first language, and so on… I’m asking because I want to give better help, and it is often very hard to help folks because I don’t know what their ‘personal context’ is.  

However, for example, if I know someone is brand new to programming and English is not their first language, I’ll approach helping them differently from someone who is experienced and isn’t dealing with the additional challenge of translating their thoughts to and from English.

Your main.lua only needs the following:

local composer = require "composer" composer.gotoScene("firstSceneName")

The loadsave stuff, I’d leave out until you’ve got the hang of composer.

Build your firstSceneName.lua file first, starting from the template, and don’t worry about the others until you’ve got something working. Keep it simple, though, maybe just one image with a tap handler. Then see if you can make two scenes, each with an image that you tap to move to the other scene. Once you’ve got a simple set-up like that, you can try to fill in the other details, one bit at a time, and testing it out regularly so as not to pile up the errors.

You don’t need to convert to composer. You can download the open source version of storyboard and continue to use that without any changes.

NB you may be missing out on bug fixes so choose wisely.

oh ok im so sorry about that, i am reading and writing most of this on a phone. but yea sorry English is not my first language.  and i have had really bad education in my life. i just usually let the computer correct my mistakes.  

 i want to thank you all for helping me. i never really programmed in my life. i have been studying it for all most one year now about 2 or 3 hours a day to every other day when i have time from work. 

and i also been helped out alot from hasty. but i dont like to ask a lot of question to one person to often so i dont feel as though im a bother. so i thank him alot for helping me. so i figured i would post a question that i cant figure out on my own after a few days of trying to figure it out on my own. 

@nickjwellis,

First, you should absolutely ask questions.  I encourage you to do your best to solve things on your own,  to google things, to read articles, etc.  However, sometimes you get stuck and the forums are the place to get unstuck.

Second, good for you!  If you have a passion about app and game development, or are even mildly curious, then you should go for it.  You are, so that says a lot.

As far as English not being your first language, that is good to know.  I’ll strive to be more careful in how I answer in the future.  

Again, feel free to ask questions.  Just do your best to help us to understand what you need and you’ll be surprised how much folks help.  Of course, we may simply tell you to look at some reference(s) we know about sometimes, but that comes with the territory.

Cheers,

Ed

when i was changing over i rewrote some of the code but still kept most of it. but now its giving me a error that i dont understand. im not sure if because its in composer or because that its in storyboard it was working fine. according to the steps on the guide this should be working. 

the error is. splash lua 57 attempt to index global, gamegroup nil value stack traceback 

? in function dispatchEvent

here is also the code

[lua]

local composer = require( “composer” )

local scene = composer.newScene()


– All code outside of the listener functions will only be executed ONCE unless “composer.removeScene()” is called.


– local forward references should go here


local splashscreen = display.newImage( “zzdirectionquestions.jpg” );

    splashscreen.width, splashscreen.height = display.contentWidth, display.contentHeight

    splashscreen.x, splashscreen.y = display.contentWidth / 2, display.contentHeight / 2

    splashscreen:scale(1.0, .5)

local function removeSplash(event)

    splashscreen:removeSelf()

    splashscreen = nil

    end 

    timer.performWithDelay(1900,removeSplash)

     

     

    local text2 = display.newText( “loading…”, 150, 250, native.systemFont, 16 )

    text2.x = 165

    text2.y = 250

    text2:setFillColor(0,0,0)

     

          

    local function removetext2(event)

        text2:removeSelf()

        text2 = nil

    end 

    timer.performWithDelay(1000,removetext2)

– “scene:create()”

function scene:create( event )

    local sceneGroup = self.view

    

        _W = display.contentWidth*0.5;

        _H = display.contentHeight*0.5;

        

         

         local background = display.newRect(0,0, display.contentWidth, display.contentHeight)

        background.x = _W; background.y = _H;

        

        

        local text = display.newText( “Continue”, 100, 500, native.systemFont, 20 )

        text.x = _W; text.y = _H;

        text:setFillColor(0,0,0)

        gameGroup:insert(text)

        

         function touchEvent(event)

            if event.phase == “ended” then

                storyboard.gotoScene(“menuscreen”)

            end

        end

        

     

        text:addEventListener(“touch”, touchEvent)

        

        gameGroup:insert(background)

        gameGroup:insert(splashscreen)

        gameGroup:insert(text)

        gameGroup:insert(text2)

        

        splashscreen:toFront()

        text2:toFront()

  – Initialize the scene here.

    – Example: add display objects to “sceneGroup”, add touch listeners, etc.

end

        

  

– “scene:show()”

function scene:show( event )

    local sceneGroup = self.view

    local phase = event.phase

    if ( phase == “will” ) then

        – Called when the scene is still off screen (but is about to come on screen).

    elseif ( phase == “did” ) then

        – Called when the scene is now on screen.

        – Insert code here to make the scene come alive.

        – Example: start timers, begin animation, play audio, etc.

    end

end

– “scene:hide()”

function scene:hide( event )

    local sceneGroup = self.view

    local phase = event.phase

    if ( phase == “will” ) then

        – Called when the scene is on screen (but is about to go off screen).

        – Insert code here to “pause” the scene.

        – Example: stop timers, stop animation, stop audio, etc.

    elseif ( phase == “did” ) then

        – Called immediately after scene goes off screen.

    end

end

– “scene:destroy()”

function scene:destroy( event )

    local sceneGroup = self.view

    – Called prior to the removal of scene’s view (“sceneGroup”).

    – Insert code here to clean up the scene.

    – Example: remove display objects, save state, etc.

end


– Listener setup

scene:addEventListener( “create”, scene )

scene:addEventListener( “show”, scene )

scene:addEventListener( “hide”, scene )

scene:addEventListener( “destroy”, scene )


return scene

[/lua]

what am i missing. 

This:

function scene:create( event ) local sceneGroup = self.view

You’re using sceneGroup here, but gameGroup on line 57.

  1. it is a good idea to convert to composer.

  2. storyboard and composer are very similar, composer is the new improved version of storyboard, so converting over your code will be easy and fairly quick.

  3. looks like you have maybe 3 or 4 'scene’modules. Most of the code in them you can cut and paste into a new composer files, using composer template.

  4. get the composer ‘scene’ template from here …  https://docs.coronalabs.com/daily/api/library/composer/index.html#template

I had actually type out several paragraphs on how I would go about converting over your code from storyboard to composer … and then realized you are better off ‘not reading my overly wordy explanation’ and doing these 2 things:

  1. How to convert from storyboard to composer is better explained here:

https://docs.coronalabs.com/api/library/composer/migration.html

  1. As you are new to this, I think it is best (just my opinion), rather then just cut and paste old storyboard files to composer files…  it is better to start a new app/project and just ‘re-rtype’ all that code using the composer template in each of the new scene files. You don’t use the template in main.lua

First, read the link above about converting to composer.  I would also try and find 1 or 2 examples/tutorials of a very simple small app that used composer… and go over them.

You can find some samples or tutorials searching the corona forums and the internet.

Good luck… hope this helps a little.

Bob

ok thank you but i decided to follow that guide and its confusing me. i copy pasted the scene template and built on to it, but nothing happens, not even a image, i was also told that all you need in the main.lua file is 3 codes to make it work, i cant seem to find the 3 codes. i have a splash screen that’s so post to start up the min i hit launch. but all i get is a blank screen. i know how to write code just in the main.lua file. but i i need a total of 4 modules/screens/scenes. it should be about 5 or 6 different files. im trying to figure out how to incorporate them together. basically as soon as the app launches i want a 2 second title screen that can be skipped if pressed early, then strait to the menuscreen. menu screen will have 3 buttons. continue/reset/about. at this point im thinking about scratching out the about screen since i cant seem to figure out what should be there. then when you hit continue, it will then take you to the game screen. then obviously when you hit the menu button it takes you back. but i want it to save where you left off. unless when your in the menu screen you can choose to reset the app, it will then reset the app right back  to the beginning. so basically i just need help figuring out what code goes where now. also what do i put in each screen to make it work since i have all storyboard codes.

TL&DR Your last post starting “ok thank you…”  It is all mashed into one long run-on.  Not sure if you typed that on a phone, or just don’t use paragraphs.  I’m only mentioning this because poorly formatted posts get less help because they are hard to read.  I want to help, but honestly don’t have the time to puzzle through confusing and hard to read questions.

Regarding the stated topic of this post:

The Corona Staff have already provided resources to help you with this:

There is nothing we can say here that isn’t already said in the first article and the second link has lots of useful stuff too.  

PS - cyberparkstudios make an excellent point.  Re-write from scratch instead of copy-pasting your code or you new composer files will be a hot-mess and confusing. 

I frequently write a prototype, then re-write it.  This is a great way to learn and to improve.  Well formatted tight code is highly-undervalued.

http://gamasutra.com/blogs/VasileiosKaravasilis/20151005/255286/Refactoring_the_Way_to_Perfection.php

Question: Can you tell us what your background is?  i.e. Programming experience, prior game dev, is English your first language, and so on… I’m asking because I want to give better help, and it is often very hard to help folks because I don’t know what their ‘personal context’ is.  

However, for example, if I know someone is brand new to programming and English is not their first language, I’ll approach helping them differently from someone who is experienced and isn’t dealing with the additional challenge of translating their thoughts to and from English.

Your main.lua only needs the following:

local composer = require "composer" composer.gotoScene("firstSceneName")

The loadsave stuff, I’d leave out until you’ve got the hang of composer.

Build your firstSceneName.lua file first, starting from the template, and don’t worry about the others until you’ve got something working. Keep it simple, though, maybe just one image with a tap handler. Then see if you can make two scenes, each with an image that you tap to move to the other scene. Once you’ve got a simple set-up like that, you can try to fill in the other details, one bit at a time, and testing it out regularly so as not to pile up the errors.

You don’t need to convert to composer. You can download the open source version of storyboard and continue to use that without any changes.

NB you may be missing out on bug fixes so choose wisely.

oh ok im so sorry about that, i am reading and writing most of this on a phone. but yea sorry English is not my first language.  and i have had really bad education in my life. i just usually let the computer correct my mistakes.  

 i want to thank you all for helping me. i never really programmed in my life. i have been studying it for all most one year now about 2 or 3 hours a day to every other day when i have time from work. 

and i also been helped out alot from hasty. but i dont like to ask a lot of question to one person to often so i dont feel as though im a bother. so i thank him alot for helping me. so i figured i would post a question that i cant figure out on my own after a few days of trying to figure it out on my own. 

@nickjwellis,

First, you should absolutely ask questions.  I encourage you to do your best to solve things on your own,  to google things, to read articles, etc.  However, sometimes you get stuck and the forums are the place to get unstuck.

Second, good for you!  If you have a passion about app and game development, or are even mildly curious, then you should go for it.  You are, so that says a lot.

As far as English not being your first language, that is good to know.  I’ll strive to be more careful in how I answer in the future.  

Again, feel free to ask questions.  Just do your best to help us to understand what you need and you’ll be surprised how much folks help.  Of course, we may simply tell you to look at some reference(s) we know about sometimes, but that comes with the territory.

Cheers,

Ed

when i was changing over i rewrote some of the code but still kept most of it. but now its giving me a error that i dont understand. im not sure if because its in composer or because that its in storyboard it was working fine. according to the steps on the guide this should be working. 

the error is. splash lua 57 attempt to index global, gamegroup nil value stack traceback 

? in function dispatchEvent

here is also the code

[lua]

local composer = require( “composer” )

local scene = composer.newScene()


– All code outside of the listener functions will only be executed ONCE unless “composer.removeScene()” is called.


– local forward references should go here


local splashscreen = display.newImage( “zzdirectionquestions.jpg” );

    splashscreen.width, splashscreen.height = display.contentWidth, display.contentHeight

    splashscreen.x, splashscreen.y = display.contentWidth / 2, display.contentHeight / 2

    splashscreen:scale(1.0, .5)

local function removeSplash(event)

    splashscreen:removeSelf()

    splashscreen = nil

    end 

    timer.performWithDelay(1900,removeSplash)

     

     

    local text2 = display.newText( “loading…”, 150, 250, native.systemFont, 16 )

    text2.x = 165

    text2.y = 250

    text2:setFillColor(0,0,0)

     

          

    local function removetext2(event)

        text2:removeSelf()

        text2 = nil

    end 

    timer.performWithDelay(1000,removetext2)

– “scene:create()”

function scene:create( event )

    local sceneGroup = self.view

    

        _W = display.contentWidth*0.5;

        _H = display.contentHeight*0.5;

        

         

         local background = display.newRect(0,0, display.contentWidth, display.contentHeight)

        background.x = _W; background.y = _H;

        

        

        local text = display.newText( “Continue”, 100, 500, native.systemFont, 20 )

        text.x = _W; text.y = _H;

        text:setFillColor(0,0,0)

        gameGroup:insert(text)

        

         function touchEvent(event)

            if event.phase == “ended” then

                storyboard.gotoScene(“menuscreen”)

            end

        end

        

     

        text:addEventListener(“touch”, touchEvent)

        

        gameGroup:insert(background)

        gameGroup:insert(splashscreen)

        gameGroup:insert(text)

        gameGroup:insert(text2)

        

        splashscreen:toFront()

        text2:toFront()

  – Initialize the scene here.

    – Example: add display objects to “sceneGroup”, add touch listeners, etc.

end

        

  

– “scene:show()”

function scene:show( event )

    local sceneGroup = self.view

    local phase = event.phase

    if ( phase == “will” ) then

        – Called when the scene is still off screen (but is about to come on screen).

    elseif ( phase == “did” ) then

        – Called when the scene is now on screen.

        – Insert code here to make the scene come alive.

        – Example: start timers, begin animation, play audio, etc.

    end

end

– “scene:hide()”

function scene:hide( event )

    local sceneGroup = self.view

    local phase = event.phase

    if ( phase == “will” ) then

        – Called when the scene is on screen (but is about to go off screen).

        – Insert code here to “pause” the scene.

        – Example: stop timers, stop animation, stop audio, etc.

    elseif ( phase == “did” ) then

        – Called immediately after scene goes off screen.

    end

end

– “scene:destroy()”

function scene:destroy( event )

    local sceneGroup = self.view

    – Called prior to the removal of scene’s view (“sceneGroup”).

    – Insert code here to clean up the scene.

    – Example: remove display objects, save state, etc.

end


– Listener setup

scene:addEventListener( “create”, scene )

scene:addEventListener( “show”, scene )

scene:addEventListener( “hide”, scene )

scene:addEventListener( “destroy”, scene )


return scene

[/lua]

what am i missing. 

This:

function scene:create( event ) local sceneGroup = self.view

You’re using sceneGroup here, but gameGroup on line 57.