How do i make: unlock level system?

0 favourites
  • 6 posts
From the Asset Store
Unlock Levels, Worlds & skin plus add coins by watching ads
  • 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?

  • Try Construct 3

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

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

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