Restarting your app

There has been a feature which seems to be a staple in all Apps that I have not found much information on. That is restarting your app after the game or other function completes. The best description for what I am looking for would be in a game app such as Pac-Man. When Pac-Man loses all his lives it is game over, but instead of forcing the user to close out the app and then re-open it, how would you go about allowing them to hit a restart button and start the app over from within the app? From a coding standpoint I know you would need to unload everything from memory but it see,s as if that may be tedious (eg.: unloading Pac-Man character, ghosts, pellets, level, lives, fruit, score, etc.). Is there any app on the code exchange that has something similar to this? I tried Carlos’ Breakout game but once it is Game Over your done. Any help on this subject would be greatly appreciated and I thank you in advance for any replies. :slight_smile: [import]uid: 50511 topic_id: 10901 reply_id: 310901[/import]

Hey there :slight_smile:

If you are using director and your variables are not global, then simply by returning to the main.lua file would work.

Are you using director? If not let me know (I can post a link to an easy tutorial), you will want it. It makes this kind of thing so easy it’s ridiculous :wink:

Peach [import]uid: 52491 topic_id: 10901 reply_id: 39764[/import]

Thanks for replying Peach :slight_smile:

I am not using Director and unfortunately think I may be too far into my program to redo it with Director (although I’m not really sure what Director is o.O). Any type of help would be appreciated and I may be able to redo my project using Director. Thanks again! [import]uid: 50511 topic_id: 10901 reply_id: 40201[/import]