0 Favourites

How do i make: unlock level system?

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

  • 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 it?s locked or unlocked then allows to click on the respective button and changes it?s animation frame.

    If you don?t understand let me know, then I try to make a simple capx to explain.

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

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

  • Construct 3

    Buy Construct 3

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

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

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
234 61,257
DARKSETH's avatar
DARKSETH
Unread hot topic
167 14,517
DMT2005's avatar
DMT2005
Unread hot topic
152 19,242
Magistross's avatar
Magistross