Reputation: 17
Is there a way to reset an application so that it runs as if it hasn't been opened yet without exiting the app?
I'm making a game and when you complete all the levels and get back to the main menu and start again, it thinks you have already completed all the levels already.
Upvotes: 0
Views: 48
Reputation: 31016
The exact details depend on the application but, basically, this is why having the "M" in "MVC" (a data model) as a separate layer is a good idea. You write a method that sets your entire model into a starting state and call it when you want to reset everything.
Once that's done, go back to your menu (the way to "go back" depends on how you've added levels) and it's a fresh start.
Upvotes: 1