How do I, complex menu?

Get help using Construct 2

Post » Sun Feb 16, 2014 8:34 pm

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.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sun Feb 16, 2014 8:55 pm

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.

etcetera..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Feb 16, 2014 9:54 pm

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?
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sun Feb 16, 2014 10:02 pm

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.Kyatric2014-02-16 22:04:23
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Sun Feb 16, 2014 10:08 pm

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.
B
15
S
4
G
1
Posts: 168
Reputation: 2,177

Post » Sun Feb 16, 2014 10:18 pm

K, thank you guys, gimme a spell to work on it, then I'll post it and you can tell me what you think.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sun Feb 16, 2014 11:15 pm

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.VIKINGS2014-02-16 23:16:57
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sun Feb 16, 2014 11:38 pm

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
AND
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.

ExampleSilverforce2014-02-16 23:39:33
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Mon Feb 17, 2014 8:48 am

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.VIKINGS2014-02-17 12:47:49
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Mon Feb 17, 2014 12:43 pm

Is the logic here correct?

http://s17.postimg.org/tm6hpobbz/options_menu.jpg

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?VIKINGS2014-02-18 10:02:53
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Next

Return to How do I....?

Who is online

Users browsing this forum: ladjuric, plinkie, Syazanie Amirin and 3 guests