Locked Levels?

triton13triton13 Member Posts: 161
edited February 2012 in Working with GS (Mac)
Hey guys, I have a quick question. I have many levels and on my main screen, I have a button under Start that says Levels. I want to have buttons in there that have the numbers of all the levels and when you click on one it goes to it. I know how to do that cause that's easy but here's my problem. I want to make them appear as a lock until they have reached the levels. When they reach each level, I want it to save so when they get to level 5 then levels 1, 2, 3 ,4 and 5 are all unlocked and the rest still have the lock image until they reach those levels. I also want it to stay saved so when they start their game back up, it has their stuff unlocked.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    You want to have an attribute called unlockedLevels. Have it set to 1 since level one will always be unlocked. When you beat a level, change attribute unlockedLevels to unlockedLevels+1

    Then in the buttons to change to the levels, in the button for level 2 have its change scene rule in a rule when attribute unlockedLevels is greater then or equal to 2. In your button to change to level 3 have its change scene rule in a rule when attribute unlockedLevels is greater then or equal to 3, and you keep doing that for all the level buttons.

    To save them just save attribute unlockedLevels whenever you beat a level, and make sure to have a load attribute behavior in the first scene of your game to load it.

    cheers
  • triton13triton13 Member Posts: 161
    Alright, thank you very much and also is there a grid or anything that could help me align my level buttons up? And one more thing, how can I make it so I swipe the screen and it slides over to another screen if I can't fit all my levels on one screen?
  • shaundunneshaundunne Member Posts: 38
    If you check out TSB's site - http://gshelper.com/ - you'll find some templates for menu systems that you can either use or learn from. There is also this video - - which goes through the lock / unlock process.

    I usually use xScope ruler to line things up on the screen.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "is there a grid or anything that could help me align my level buttons up "


    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./Screen_Grid.html


    xScope looks a lot better to be honest.
  • triton13triton13 Member Posts: 161
    Thanks guys, I followed those videos but how can I save it so it loads the levels I have unlocked if I back out of my game?
  • triton13triton13 Member Posts: 161
    Thanks man, those videos are incredibly helpful. =)
  • triton13triton13 Member Posts: 161
    edited February 2012
    Wait, I'm just a tad bit confused, sorry. Do I put the save attribute in my level number actor? If so, where do I put in there and when I do use it, I imagine I click the e and click on game.unlocklevel.
Sign In or Register to comment.