Copy link to clipboard
Copied
I'm not sure what the correct game terminology is for this, but how do you save "game state" so the user can continue next time?
This seems like a pretty important feature for building some games, we don't want users to have to start over everytime.
Any ideas if this is possible?
Copy link to clipboard
Copied
Take a look at either SharedObjects or the built in SQLLite datebase that is supported in AIR for Android as well.
Chris
Copy link to clipboard
Copied
Chris, do you know where i can view some examples of saving data for next time app is run? i have a 3 column grid i need to write to file and retrieve next run. Any help is appreciated.
thanks
Copy link to clipboard
Copied
Check out my blog post on the PersistenceManager:
http://www.unitedmindset.com/jonbcampos/2010/11/01/flex-4-5-persistencemanager/
This will help you understand how to store the data. When the app starts up again get the state information from the persistencemanager and reset you game to the state you need. It requires a bit of code for the startup, but it is relatively simple.
Copy link to clipboard
Copied
well you could set the "game" view to destructionPolicy='none' and locally save the data you need and enable a "resume" button. so even if the player presses Back or Home your app is still running as a service with low framerate. So if the player returns and presses "resume" the game goes to the "game view" which has not been deleted from memory.
Note: don't forget to return the attribute of the view to -> destructionPolicy='auto'
hope it helps.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now