How do I Make Sound off/On Effect

Get help using Construct 2

Post » Sat Jul 25, 2015 12:26 pm

Hi,
I'm developing an android game, in which I wanted to add sound off/on effect and I also added sound button to it.

Events defined as
on touch button & sound variable = 0 -> set button animation to mute
-> set sound variable to 1

on touch button & sound variable = 1 -> set button animation to unmute
-> set sound variable to 0

Now, when I touch the sound button, nothing is happening. The button is not changing when I touch it. I guess, both the events are executing at a time.

Please help me solve this problem.
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Sat Jul 25, 2015 1:52 pm

Hello, need some help please.
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Sat Jul 25, 2015 1:53 pm

Use a boolean. Make a variable on the mute button and make it a boolean instead of a number, when touched execute action on the mute button "Toggle boolean [Mute]" then after that if "is Mute", set button animation and variable to X, same with "is not Mute.

I too had this problem before, and yes, both events are triggered at the same time because one will set it to 1 and the other to 0, leaving in no result.

I´ll make a quick .capx right now anyway
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Sat Jul 25, 2015 2:01 pm

oh thanx man, i'm waiting for the .capx @CloveltOc
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Sat Jul 25, 2015 2:02 pm

B
9
S
3
Posts: 152
Reputation: 1,270

Post » Sat Jul 25, 2015 2:09 pm

Wow, thanks alot man. It's working @CloveltOc
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Sat Jul 25, 2015 2:33 pm

No problem, @sudeep98
B
9
S
3
Posts: 152
Reputation: 1,270

Post » Sat Sep 10, 2016 1:08 pm

would anyone still have a copy of this capx?
B
72
S
16
G
2
Posts: 46
Reputation: 6,297


Return to How do I....?

Who is online

Users browsing this forum: ultrafop and 18 guests