How do I, complex menu?

Get help using Construct 2

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

Post » Tue Feb 18, 2014 10:03 am

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

Post » Tue Feb 18, 2014 10:22 am

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.
B
17
S
8
G
4
Posts: 461
Reputation: 6,137

Post » Tue Feb 18, 2014 10:33 am

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
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Tue Feb 18, 2014 10:51 am

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... ) draft.

http://s8.postimg.org/nglricqgl/sound_options.jpg

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

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

http://s30.postimg.org/8cuapvpep/music_modified.jpg

LEE:Thank you lennaert, that looks like a good solution for when I make a more complicated game, I'll copy&paste it somewhere.VIKINGS2014-02-18 11:07:09
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Thu Feb 20, 2014 11:13 am

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?

http://s8.postimg.org/nglricqgl/sound_options.jpg
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Previous

Return to How do I....?

Who is online

Users browsing this forum: adamebastin, ketramtu18 and 8 guests