How do i make: unlock level system?

Get help using Construct 2

Post » Wed Mar 21, 2012 1:08 pm

Hey guys, I am trying to make a level system like angry birds or a lot of games a like. But i don't know the propper way to make the system.

I tried this: if the player crosses finish line in level 1. Set the variable "unlock" to 1 and make level 2 visible and clickable. repeat that for all the 10 levels.

But it's not working that well.

does anybody have any better ways?
B
5
Posts: 20
Reputation: 640

Post » Wed Mar 21, 2012 1:14 pm

I made it in my game
Get the Girl!

I used an array XY, where X is the "World" and Y is the Level. And I set 1 to each array value when the level is unlocked. So... My array would be something like:

LevelsUnlocked:
[1][1] = 1; (first level should be set unlocked by default on layout start)

[1][2] = 0; (means unlocked)
[1][3] = 1; (meansl locked);
... and so on...


then I have a loop to this array that checks if its locked or unlocked then allows to click on the respective button and changes its animation frame.

If you dont understand let me know, then I try to make a simple capx to explain.Jailson2012-03-21 13:15:29
B
228
S
6
G
8
Posts: 86
Reputation: 12,295

Post » Wed Mar 21, 2012 1:42 pm

Hey Jailson thanks for your fast response!

I have tried putting the array in my gam, but i simply don't understand the how arrays work. I would really appreciate it if you would make an example capx. then i i'm sure i will understand it.

btw, I like your game! fun gameplay and awesome design. Looking forward to more!
B
5
Posts: 20
Reputation: 640

Post » Wed Mar 21, 2012 3:53 pm

if your levels follow eachother up, you can just add a global variable 'highestlevel' and put the number of the level in it each time a level is finished.

then do a check for each level

- system: highestlevel equal or higher then 1
-> show button 1
B
22
S
11
G
9
Posts: 133
Reputation: 6,572

Post » Wed Mar 21, 2012 3:57 pm

Ok, I will probably write something to explain better what I did.

You may also consider the advice from @Wishy, it will work too and is far away easier than my approach using Array.

My approach used Array because I had others conditions to unlock certain levels.
B
228
S
6
G
8
Posts: 86
Reputation: 12,295

Post » Sun Mar 02, 2014 3:10 am

My game is now open source. You can download the lastest version of the game at: https://github.com/jailson/getthegirl . Just click "Download the zip".

Hope it helps.
B
228
S
6
G
8
Posts: 86
Reputation: 12,295


Return to How do I....?

Who is online

Users browsing this forum: heliogame, Yahoo [Bot] and 17 guests