How do I, complex menu?

0 favourites
  • 15 posts
From the Asset Store
ready made menu you can download this one or just follow my tutorial to make it yourself
  • Hello everyone,

    So I need to make a menu for my future iOS game(everything will be touch based), now I've checked the FAQ and google and youtube, but everything I've managed to find are just examples for simple menus, like the 1945 one, and those don't really help me...

    Here is what I wanna do if you can please help:

    First button will be a "Start Game", if you click it a new screen appears with 4 levels, but only the first level is selectable, the other 3 are greyed out and will unlock in order(after you finish level 1 the second level is selectable, after you finish 2 you can play 3 and so on).

    I have a vague idea on how to achieve this(using variable, ex. "if level1 completed=true" or something like that, right?) but no idea where to start or what steps to follow.

    How do I make the buttons "untouchable" untill the var=true, how many layers do I need( one for start game menu, one for levels, one for options, and so on? Cause thats gonna end up beeing 10++ layers just for the menu...)

    Second button under "Start Game" will be "Options". When you click this you will be taken to another screen where I want to have 2 sliders one for music level and one for effects level. No idea how do this...

    Then 2 more buttons "How to play" and "Quit Game" these 2 should be pretty simple, right?

    If there are any tutorials that explain/show how to do this and I've missed them I apologize, please link. Otherwise if you can please explain what I have to do in as much detail as possible as this is my first game and I am very much a newb.

    Thank you very much for your time&help, sorry for writing so much.

  • Like everything else in programming it's all if then.

    if global variable is 1 set level1 button to animationframe 1 (not greyed)

    on levelbutton touched - levelbutton is animationframe1 - goto level1.


  • Yeah, I suppose I can work with that, like give the greyed out sprites no event, and event only for the "normal colored" ones if var=....

    Cool, thank you.

    But what about the rest? How many layers, one for each, and waht about the sound options?

  • For the sound/music volume, check in the "How do I FAQ" at the section "Audio".

    For the menu, I don't remember if it is listed in the FAQ but you can find/search for "older than 6 months" topic in the forum advanced search for the keyword "unlock level" I think.

    My Asteroid clone in less than 100 events tutorial might also be of help to you.

    Don't hesitate to check other/more recent of my tutorials.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can always try what I did for an in-game pause menu. Make a layer for each tab, make them invisible initially, and then have each button set to make it's corresponding tab visible when the player clicks on it (and others invisible again, of course).

    It's a little more work programming-wise, but it's easier for you in the long run, in case you need to change options in the tabs and add extra tabs down the road.

    Sounds like you were pretty close to coming up with that idea on your own.

  • K, thank you guys, gimme a spell to work on it, then I'll post it and you can tell me what you think.

  • Well this ain't working... I've added a variable to the start game button, set it to false, but then when I go to the event sheets and I try to use it it tells me I have no variables and have to create one first...

    Very strange, had no problems with this in any of the tutorials I did.

  • Is your start game button on a layout already? If so, any instance variables you add to it, will be available for the event sheet to use.

    Menus are all about IF and ELSE chains, relying on global or object variables to check for what you need.

    Construct 2 is capable of making very complex menus, like in RPG skill trees (or even multiple skill trees). It is all down to user trial and error as well as experience to apply it.

    For your one, you obviously need a global variable (GV) "StageCompleted" or something like it, to keep track of progress.

    Then just add a check when you touch button.

    ie. For the 2nd stage.

    On Touch Object XXXXX


    StageCompleted >= 1

    Goto Layout: Stage 2 (Doing this will ensure they will not be able to touch/trigger that button until their completed stage 1 already!!)

    You can also have them greyed out unless they are up to a stage. Using the On Start of Layout to check for StageCompleted >= 1, then Change Animation of button for stage 2.

    I use opacity for my ability and stage icons, I set them all at 50 default so they are semi-greyed out, and 100 opacity when players are up to that stage or upgrade.

    Have a look at my Shop menu, took me a whole WEEK to get it work without bugs, lots of trial and error, but now if i need to do complex menus, take me a few minutes.


  • LE: Never mind I fixed that problem, seems I had the variable on the wrong button.

    I'll keep this post updated so please check back once in a while guys. Thank you.

  • Is the logic here correct?

    Here is what I want it to do:

    On first player click on MuteMusic, mute the background music and set var mutemusic to 1(it was 0 by default)

    On next player click check if var mutemusic=1, if it is=1 then unmute backgroundmusic and set var mutemusic to 0.

    On next player click check if var mutemusic=0... rinse and repeat.

    Olso does the "On clicked" event work for touch clicks too or just mouse clicks? If just mouse clicks then how do I change it for touch controls, cause when I select the button MuteMusic I have no touch events?

    And if I want to mute more then 1 sound with a click do I use "SoundCollision""SoundPickup"? Or with + betwhen them or &, what?

  • Bump.(it's been almost 24 hours, don't judge the bumpiness please, I'm just trying to learn as much as I can, thank you)

  • And if I want to mute more then 1 sound with a click do I use "SoundCollision""SoundPickup"? Or with + betwhen them or &, what?

    The screen you posted isn't the right logic.

    What the program will do is :

    • Ev1 : on the Mute button clicked (any click, first or not) => mute the music, set the variable to 1
    • after Ev1, if the variable is set to 1 (witch will be the case, since you just set it to 1), unmute the music and set the variable to 0.

    Here is another implementation that should do it properly : example

    You should use "onTouch" events from the touch object, since it will simulate an "onClick" too, but not the other way around. Though, on Buttons, it will work both ways.

    If you want to mute multiple sounds with a single click, just mute them one after the other, where you muted/unmuted the background sound. If you want to mute all sounds, you can change the general volume too.

  • I use a simple and effective audio control.

    I have 1 group called: Audio, somewhere in the menu sheet, no subs, no actions .. no events ...

    Events requiring sound:

    add a sub event: is group audio active -> action play sound

    add a sprite with audio on your layout

    event: on click audiosprite

    sub: group audio is active -> stop all, set group audio deactivated

    else -> set group audio activated, play background music

  • K, sorry, when I asked the second question(about muting more then one sound with the same event) I didn't have the event sheet completed.

    Here is the final(in theory... <img src="smileys/smiley2.gif" border="0" align="middle" /> ) draft.

    As you can see Guizmus on event nr. 10 when Mutesound is clicked I want it to mute both those sounds. I want to set it up this way because I want sound effects to be different from the music.

    And I don't know if I need to put an operator between them so the program can distinguish, at the moment they are just "SoundCollision""SoundPickup". Is it correct like this?

    I personally know a couple of people that really could not stand the sound Mario made when he picked up the coins, and sadly they had no such option... <img src="smileys/smiley4.gif" border="0" align="middle" />

    I'm glad to hear that on buttons "on clicked" works both ways, because initially I wanted to use on touch events on them too, but when I set up an event for a button I don't get a touch section just Button, Instance Variables, Misc and Size&Position.

    LE: I have olso modified the mutemusic and mutesound following your example. Thank you very much. The reason I was having trouble with it is because without adding a sub event first(like you did) I couldn't use the function "else". <img src="smileys/smiley32.gif" border="0" align="middle" />

    LEE:Thank you lennaert, that looks like a good solution for when I make a more complicated game, I'll copy&paste it somewhere.

  • Bump.

    So I still need to know if I have to put something(an operator or whatever you call it) in between the names of different sounds when trying to mute more then one sound with the same action. As you can see right now on event nr. 10 in the screenshot below they are just "SoundCollision""SoundPickup". Is that correct?

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