Save Game/Level Conundrum

0 favourites
  • 3 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • Hello All,

    In my game, my levels are setup a lot like "Angry Birds" and/or "Wheres My Water" where a new level unlocks after you defeat the previous level.

    I'm having a problem figuring out the logic.

    I can't "add" to the level variable because replaying a single level multiple times would eventually unlock all the levels.

    I can't "set" the number because replaying a previous level would re-set the number of levels cleared.

    If this post makes any sense to you, please help me out.

    Thank you for your time.

  • What you need to do is keep track of whether or not the level is completed. A simple solution would be to have one global variable for every level that is 0 if the level is not completed, and 1 if it is.

    Then you should only add to your "levels available" variable if that levels "completed" variable is 0.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What I do is have a currentlevel variable and a highestlevel variable.

    The current level is the one they're currently on, the highest level is the highest level they've unlocked (I set currentlevel when they choose a level).

    At the end of the level I just do if(Currentlevel = highestlevel) then {add 1 to highest level).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)