Save level only!

ranthonydevranthonydev Member Posts: 19
edited November -1 in Working with GS (Mac)
Hey all,
Before you ask, I HAVE searched the forums a bit and haven't found exaclty what I am looking for. I have a small basic platformer, and I also have a level select section in the options. All levels that haven't been accessed yet are considered locked and the user cannot select them in the level select menu. Any level that has been reached is considered "unlocked" and can be chosen at any point in the level select menu. This level select menu should save its state even after the app is closed, so the user can return to the last unlocked level later on. I know about the save and load attributes, but cannot find good documentation on how to actually use them. THIS is what I'm confused about and am really hoping someone can assist me in using them properly. Thanks!

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Have an attribute called 'Level' and make it an integer. After you complete a level (for example, level 9), change the 'Level' attribute to 9 then save the attribute (call the key whatever you want). When the game loads up, load the level attribute and use the same key, then when you go to your level select menu, make a rule that says if 'Level' = 9 then levels 1-9 can be accessed.

    This make sense?

    Ace
  • ranthonydevranthonydev Member Posts: 19
    Wow, so easy! Thanks for the quick and thorough reply Ace!
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    No problem, let me know how it turns out.

    Ace
Sign In or Register to comment.