You don’t need a separate reset file for each level. Just one.
Set up two global variables: goToScene and fxMode, and one lua file called levelrestarter.lua that contains the following:
[lua]function new()
localGroup = display.newGroup()
director:changeScene( goToScene, fxMode )
return localGroup
end[/lua]
If you already have 50 lua files of all your levels, just change the line that would restart the level to:
[lua]goToScene = “level1.lua” – or whatever level you want to restart
fxMode = “fade” – choose one of the many effects: crossfade, downFlip, flip, etc. or randomize
director:changeScene ( “levelrestarter”, fxMode )[/lua]
That should do it. [import]uid: 6084 topic_id: 6891 reply_id: 24200[/import]