How do I a toggle sound "on/off" button? 1 sprite

Get help using Construct 2

Post » Fri Aug 29, 2014 5:22 pm

How do I a toggle sound "on/off" button, only with 1 sprite and not with 2?
Please help; a .capx file will be very helpfull thanks!
B
8
Posts: 22
Reputation: 356

Post » Fri Aug 29, 2014 5:25 pm

Use a boolean variable
- on button pushed toggle boolean
(subevent)
if boolean = true - set sound on

else set sound off
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 » Fri Aug 29, 2014 11:01 pm

how can add this variable? / Which is the instance variable for the toggle boolean?
Construct 2 missage: Instance Variable--> <none - add an instance variable first>
B
8
Posts: 22
Reputation: 356

Post » Fri Aug 29, 2014 11:43 pm

AYALA6 wrote:how can add this variable? / Which is the instance variable for the toggle boolean?
Construct 2 missage: Instance Variable--> <none - add an instance variable first>


Search "Variables" in the manual. Fully read and understand the first 5 hits. You will have greater challenges than this in making any game.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Aug 30, 2014 8:53 am

make a sprite with 2 animations - on and off
Then,
When someone presses the sprite,
Make a sub-event --> is playing on, then set animation to off and stop music
else --> set animation to on and play music
B
15
S
3
G
1
Posts: 111
Reputation: 1,664


Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, unicornspitfire and 21 guests