how to unlock specific levels and not other levels.

In the game i am working on, level 10 has 4 different path ways, each path ways allow you to go to a different level. Currently if you beat any of the path ways on level 10 all the next four levels unlock. I want to make it so when i beat one path way on level 10 only one level unlocks (11,12,13or14) and the other levels remained locked until i complete each of the path ways corresponding with their ultimate level.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Create an integer attribute called game.highestUnlockedLevel and set it to 10.

    When [condition to beat a pathway]
    Change Attribute game.highestUnlockedLevel to game.highestUnlockedLevel+1

    Then use game.highestUnlockedLevel to determine if that level (e.g. 11, 12, 13, or 14) is unlocked.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • TyDietrichTyDietrich Member Posts: 45

    yes but wouldn't that make it so if i go down the pathway to level 13, on level 10 before i go down pathway 11 and 12, then 11 and 12 would be unlocked along with 13 since i am unlocking level +3 on that pathway. That would make the attribute +1 and +2 unlocked.

    I just thought of this and think it might work. If i create a 4 boolean attributes for each pathway and make it so if (main actor) beats pathway to level 11, then level 11 unlock = true. and if play does not beat pathway to level 11, then level 11 unlock = false.

  • TyDietrichTyDietrich Member Posts: 45

    what i did worked.

Sign In or Register to comment.