Making levels locked, AND Question about saving,
rickyniko
Member Posts: 85
Hi everyone,
was wondering how i can make it for example, you cant unlock level 3, unless Level 2 is completed, etc,
and.
how can i save everything? is there a way to have it save whenever the user clicks the home button so next time they open the app it is back to where they left it?
thanks everyone!
was wondering how i can make it for example, you cant unlock level 3, unless Level 2 is completed, etc,
and.
how can i save everything? is there a way to have it save whenever the user clicks the home button so next time they open the app it is back to where they left it?
thanks everyone!
Comments
For your first question, you're going to need to track which level the player has completed. Usually I have a, level (which level it is), currentLevel(which level the player is on) & completedLevel (the last level the player has beat) attribute. On my level selection screen I have rules that say:
if level > completedLevel
show lock button
if level < completedLevel
goto scene XXX.
To actually have this work however, you'll need code to execute right before your level ends that saves progress. Something like:
if currentLevel > completedLevel
change attribute completedLevel = currentLevel
save attribute completedLevel keyword completedLevel
goto NextScene
when you start your game, make sure you actually load that completedLevel value
load keyword completedLevel attribute completedLevel
Having the game resume where they left off exactly is done automatically by using iOS4. GS can't really support it right now.
*im doing this from memory, so the exact code may be slightly different
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
as for the iOS4 multitasking thing, what would happen if the user actually exited the app from the multitask bar? it would end up closing the app, so anyone how would i save it?
THANKS