trouble with simple level lock/unlock idea

SAMmanSAMman Member Posts: 228
edited November -1 in Working with GS (Mac)
hey guys, I have a level select screen set up before you play the game and it has to arrows, one on each side of a number that says what the level is. I am trying to make it so that when I click an arrow it makes the level go up or down in the game, then you can click play and start at that level. That works fine, but i want to limit how high up you can go to how many levels you have actually passed in the game. I'm pretty stuck. anyone have any ideas? Thanks.
SM

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    well lets say you are basing it all off of an integer attribute. called levelnumber

    In your arrows add some conditions that disable when the attribute reaches your value. So say our range is 1 through 20

    in your down arrow
    When touch is pressed
    and when game.levelnumber is > 1
    --change game.levelnumber to game.levelnumber-1

    In you up arrow

    When touch is pressed
    and when game.levelnumber is < 20
    --change game.levelnumber to game.levelnumber+1
  • SAMmanSAMman Member Posts: 228
    that will help limit it to not going past level 20, but I want to make it so you have to pass the level first before you can select it. how do I tell the game that the level has been passed an it is ok to proeceed to the next level? I hope that makse sense.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yeah you just have to setup a second integer attribute that called levelunlock

    And when each level is completed have game.levelunlock increase by one.

    Then your button rule would be

    when touch is pressed and
    when game.levelnumber is less than or equal to game.level unlock.
    --Change scene etc….

    Also if you search for Simple Level Lock/Unlock System in gamesalad under new you will get a nice little simple free demo that I made that should help you setup your lock/unlock system.

    Also just to make you aware of all your options I actually have a pretty cool template I sell that might add an extra little pizzaz to the type of level select you are creating. http://gamesalad.com/forums/topic.php?id=23688 Check out "Menu Number 3"
  • SAMmanSAMman Member Posts: 228
    nice, thanks!
Sign In or Register to comment.