Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

How do you save "game state" so the user can continue next time?

Contributor ,
Feb 17, 2011 Feb 17, 2011

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?

TOPICS
Development
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2011 Feb 17, 2011

Take a look at either SharedObjects or the built in SQLLite datebase that is supported in AIR for Android as well.

Chris

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 25, 2011 Apr 25, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 26, 2011 Apr 26, 2011
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 18, 2011 Feb 18, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines