You just need two files… you need your level file… and then you need a load level file. When your game is over… and you click retry… the retry button would switch scenes to your load level file…
director:changeScene( loadLevel, "crossfade" )
and your load level file would look something like this.
module(..., package.seeall)
-- Main function - MUST return a display.newGroup()
function new()
local localGroup = display.newGroup()
local theTimer
local loadingImage
local showLoadingScreen = function()
local goToLevel = function()
director:changeScene( "lvl" )
end
theTimer = timer.performWithDelay( 10, goToLevel, 1 )
end
showLoadingScreen()
unloadMe = function()
if theTimer then timer.cancel( theTimer ); end
if loadingImage then
loadingImage:removeSelf()
loadingImage = nil
end
end
-- MUST return a display.newGroup()
return localGroup
end
[import]uid: 28912 topic_id: 12783 reply_id: 46868[/import]