0 Favourites

Save Game/Level Conundrum

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Physics gravity conundrum
45 2,807
SoldjahBoy's avatar
SoldjahBoy
Unread hot topic
44 7,747
Ashley's avatar
Ashley Construct Team Founder
Unread hot topic
0 Favourites
Saving Layouts?
42 6,638
kayin's avatar
kayin