• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

Windows Advance Level Unlocking


GM Version: Gamemaker Studio 2
Target Platform: all
Download: Click Here
Links: N/A
Unlock level system which allows you to unlock as many levels in any order you wish.

Unlike the basic system which i posted here which only worked if you unlock levels one after the other. This one actually tracks whats happening in an individual level. Meaning it offers a lot more control and allows you to use it how you please.

And here's a snippet of code from the engine:

    image_index = 1; // show unlocked
else if(ds_map_find_value(global.lvlData[levels],"unlocked")==0) image_index = 0; // other wise its lower and still locked

if(ds_map_find_value(global.lvlData[levels],"beat")==1) { // if we have unlocked more then we must of beat it
    image_index = 2;

So the run down here is it uses an array. Each index of the array holds a ds_map which stores data on our level. If you haven't ever used a ds map it's pretty easy don't worry. It's kind of like an having a bunch of arrays which you can refer to with a keyword. In our case each one of ours will look like this:

"unlocked": [1]
"beat": [0]
The numbers inside of the brackets is the data on our level. And the keyword is how we look at it. And each index of our array has one of these which represents each one of our levels.

The controls when you're testing are:
- left click checks if it's unlocked or not
- right click unlocks a level if it's locked or if it's already unlocked then it beats it

What I love most about this, is it's really easy to expand to track other stuff like how many times you die in a level or how fast you beat it in etc.... so what do you all think?
Last edited by a moderator: