hi,
How would I set my game to resume from where the user has left off when they press the home button to exit?
Will IOS automatically take care of this or do I need to program it in?
Thanks [import]uid: 8699 topic_id: 6579 reply_id: 306579[/import]
hi,
How would I set my game to resume from where the user has left off when they press the home button to exit?
Will IOS automatically take care of this or do I need to program it in?
Thanks [import]uid: 8699 topic_id: 6579 reply_id: 306579[/import]
You need to program it. You can find info here:
http://developer.anscamobile.com/reference/index/eventtype-0 [import]uid: 11809 topic_id: 6579 reply_id: 22823[/import]
Thanks for the reply.
I’m still not sure what I need to do though. I have tried searching but can’t seem to grasp it.
Do I need to tell the app to do anything or do I just need a listener to wait for the event? [import]uid: 8699 topic_id: 6579 reply_id: 23003[/import]
Does corona support multi-tasking? thats what I mean when I say suspend and resume.
Thanks [import]uid: 8699 topic_id: 6579 reply_id: 23012[/import]
Corona SDK doesn’t support multi-tasking at this time, but when the app exits you could save the state of the game and then when the user launches it again, look and see if there was a saved game. If so, give the user the choice of New Game or Continue Game. If they choose the latter, load up the state of the game and go from there.
So how do you save and load the game state? Basically, you need to save everything that would be needed to start the game from that point – a game of checkers, for example, would need to save which board squares have pieces, whose turn it is, etc.
One way to save/load the data is by using SQLite. You can find more info about that here:
http://developer.anscamobile.com/content/data-storage
Or you could just save the info as a text file. If you go that route, grab the Crawl Space Lib and use the saveData and loadData functions to make it easy. You can find there here:
http://www.crawlspacegames.com/crawl-space-corona-sdk-library/
I hope that helps.
Jay [import]uid: 9440 topic_id: 6579 reply_id: 23162[/import]
Hi,
Thanks for the reply.
I think I may try to implement the option to continue a saved game. I don’t think I would have too many variables to load.
Thanks for the info.
Gary [import]uid: 8699 topic_id: 6579 reply_id: 23329[/import]