I tried to retro fit an app I’m working on to launch an instructions screen before running the main part of the app. The code I used crashes Corona. If there’s a better way to do this, I’d welcome the help.
bgGroup = display.newGroup()
local background = display.newImage(“background.png”)
bgGroup:insert( background )
–intro screen
local wait = 1
local introDisplay = function()
while wait == 1 do
–endless loop until screen detects touch
end
end
local function introRemove (event)
local t = event.target
local phase = event.phase
if “began” == phase then
instructions:removeEventListener( “touch”, introRemove )
bgGroup:remove(instructions)
wait = 0
end
end
local instructions = display.newImage(“Default.png”)
bgGroup:insert(instructions)
instructions:addEventListener( “touch”, introRemove )
introDisplay()
[import]uid: 1560 topic_id: 378 reply_id: 300378[/import]