Save Game/Level Conundrum

Get help using Construct 2

Post » Thu May 17, 2012 7:28 pm

   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.
B
23
S
7
Posts: 79
Reputation: 2,215

Post » Thu May 17, 2012 7:52 pm

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.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu May 17, 2012 8:34 pm

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).
B
22
S
6
G
10
Posts: 118
Reputation: 8,005


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83 and 19 guests