How do I create a play next level button?

Hey guys, first off there are no screen shots because I’m only looking for generic suggestions. I am making a game that has 10 levels (to start with). I want a button on the home screen called “Play” where the player can open the game, click the Play button, and it will take them to the first level they have not yet cleared. Would it be best to use an array, or? I have no ideas how to have that button play the next unfinished level of the game.

In regards to levels, I have created a select level screen that uses a structure array with 10 boolean children. As level1 is completed it marks the first child of my structure array as true, and so on with the other levels. The select level screen uses that array to darken out any level whose boolean value is false. This all works properly, but I don’t think that particular array would be helpful here unless someone knows a way to have it play the first level with a false boolean value? Given I have no other arrays or global variables set up yet, and I doubt this array will help, I chose not to insert screen shots. I just need to know how such a thing can be done.

I had the idea of having each level add it’s level number as a number in a structure array. And then having the game get the highest number in the array, add 1 to it, and play that level. But then I don’t really know how to do any of that yet. PLEASE HELP WITH IDEAS! AND THANK YOU!

This might not answer all your questions but it helped me a lot with the same problem.
Level Select Menu - Intermediate Tutorial

I watched it again, but didn’t give me any new ideas. I used that video to make my level select screen. Thank you for the suggestion.

You probably need a “while” event:
https://wiki.gdevelop.io/gdevelop5/events/while

I am also trying to make a player choose screen with player avatars and towers as arrays shown upon click and a final play button. All help will be appreciated:

PS- This will be the first time i’ll be using arrays and structures so try to be noob-friendly!

Ouch. I didn’t realize it was your first time when I replied to your other post. I guess sometimes you can either stick a toe in the water or just jump. Proceed at your own pace. We’ll help explain any concept that you need. It’s not that bad. Variables are very organized . Once you understand the setup, it’s not too bad. Arrays and structures can take time to setup but once setup, it makes the code part much easier. It reduces the redundancy and makes the events more fluid or dynamic.

It’s like the diffence of using 50 for speed or a variable. If you used 50 and change your mind then you need to change all of the places where you used 50 but with a variable, you just need to change the variables value in one place.