Legacy GM How to make a progressive level unlock / select system



Hello! I'm trying to make a progressive level unlock (and level select) system in my game. There are over 30 levels in the game right now, but every single one is unlocked on the level select screen when you start the game. I would like to only have level 1 unlocked at the start, and that you have to complete that level to unlock the next one and so on.

I already have a global variable called global.level_complete which is set to 'true' whenever the player completes the current level. However, I don't have a specific variable for every level (or room, if you'd like). I wouldn't have that big of a problem with adding that, although I still don't really understand how I would go about making a level unlock system even if I did have a unique variable for every room.

I tried to do something similar to this; (haven't tested it just wrote this in the post but something similar was in the project's code)

//In current level var_object

if global.level_complete {
room_next().completed += 1;

//In the next level var_object

if self.completed >= 1 {
self.unlocked = true;
...but I don't really know really.

Any help would be very much appreciated!

- Henriko


You could make a global array
for(var i=0;i<=max_number_of_levels;i++)
  global.level_complete[i] = false;
global.level_complete[0] = true;
and then check that array for level progression and to determine whether or not the level will show up in a stage select.