How do I Make a Level Select Menu?

0 favourites
  • 11 posts
From the Asset Store
A complete set of Graphic, User Interface element to build 2D mobile game or PC game.
  • I've been trying to make a level select menu for a bit now, and at first it seemed to work. But once I incorporated what color the level buttons are (based on if they are locked or not), it went downhill. Every time i changed it, it either locks all the levels or unlocks all the levels. I even used another person's template with a level select menu, but it still doesn't work. Please help!

  • Look at my code if you can't understand it let me know. I can help you out.

  • My guess at the problem, despite very limited information:

    Are you using 'for each'?

    You probably have a 'picking' problem, as in picking all of them. Therefore it is applying it to all of them.

  • PixelPower:

    I understand that this way works, but I'm coding a 25+ levels game, and I feel like that this is just way too much work that clutters the work space, even if it is a copy and paste thing. Any way that this could be made simpler that uses less coding, but still works for 20+ levels?


    No, I'm not using for each. I just set it to 'If animation frame = 1, go to "level" & SelectionButton.level_Number' (SelectionButton being the buttons in the level select, level_Number being the instance variable that shows what level each button is for). Then, I set 'If animation frame = 0, play sound (whatever sound i want)' which means the button is locked. I also have it like, 'if (global variable) is > or = to SelectionButton.level_Number, set ani frame to 1', and 'if (global variable is < SelectionButton.level_Number, set ani frame to 0'. Is there something that is off with this coding? I don't know why it doesn't work.

  • If you are doing system-global variable > instance.variable I don't believe it is picking any of those instances, so all are picked. If you do sprite instance.variable < global variable then I believe it would pick only those instances that are true.

    I would recommend though:

    on layout start

    -for each (menu)

    --if instance variable < etc etc

    ---then animate x

    --else; animate x

    I'm not entirely sure if that is necessary but is usually safer.

  • I dont know what to say but making games is work. You can try to UDID method if you want to use 1 sprite only and just make duplicates but even thats a bit of work. Trust me we all go through it. I am making a Metroid style game now and I am banging my head on the wall its hard work but will pay off.

  • Just consider posting your capx, this will be the easiest way to investigate what is going wrong and what appropriate solution can be applied.

    Although I do believe the description you gave indeed sounds like a picking issue that badmoodtaylor hinted at.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ezgaming420

    Ok I got the easiest way

    Have a sprite that has 2 animations open and locked , set the animation to locked. To set the animation to open do this.

    System = compare variable = choose sprite = set animation "open"

    Its one line of code , can't get easier than that.

  • Have you looking my example? It uses array for managing progress like in Angry Birds and a such. ... eMenu.capx

  • Thanks everyone! I'll take all your suggestions in consideration.


    How do I post my capx file? I never did so, and I don't know how.

  • Host your capx file on some online service (dropbox, google drive, prefer services that offer the download in one click, without ads and so on) and provide the public link to the file in a message posted in the forums.

    As you are a new user, posting the link make sure to either post it as plain text putting spaces in the url so it isn't simply deleted by our spam filter, or consider earning quickly enough reputation to be able to post URLs.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)