We will rename our current main.lua
file to maingame.lua
and add some additional lines to our game code. Be sure to change the file name within your Egg Drop
project folder. To rename the file follow these steps:
Remove the following lines near the top of the code. We'll hide the status bar in another scene that we'll create later on in this chapter. The
gameGroup
display group will be altered to fit within the Composer parameters:display.setStatusBar( display.HiddenStatusBar ) local gameGroup = display.newGroup()
At the very top of the code, implement Composer by adding
local composer = require( "composer" )
andlocal scene = composer.newScene()
so that we can call the scene events:local composer = require( "composer" ) local scene = composer.newScene()
After
local loadValue = function( strFilename )
, add in thecreate()
event. We will also add back in ourgameGroup
display group, but under the scene's view property. Also, add incomposer.removeScene...