Hey guys,
As you can see in my sig, I'm working on a game called the bomb. Some people might find the heartbeat sound quite annoying so I want to put a mute button on.
Any ideas how to do this? I tried but I can't make it stop straight away.
Offline
You can use this block on the sprite that's making a noise saying "set sound to 0%"
Offline
Since scratch's volume controls only work for the sprite that it is on, you need to use a variable, call it mute. Put this script in all of the objects that make sound:
<when green flag clicked>
<forever>
<if><( Mute <=> 1 )>
Set Volume to 0%
<else>
Set Volume to 100%
<end>
Offline
Doesn't seem to work. I need a mute toggler.
Edit false Alarm didn't see the one up front. I'll try that.
Last edited by Stickman704 (2010-02-13 08:46:48)
Offline
Ok thank you. Any idea how to turn it back on again?
Offline
Put this script:
<when green flag clicked>
<forever>
<if><< <key[ m ]pressed?> <and> <( Mute <=> 1 )> >>
<set{ Mute }to( 0
<end>
<if><< <key[ m ]pressed?> <and> <( Mute <=> 0 )> >>
<set{ Mute }to(1
<end>
Really you can use any key you want, but I just put m as an example.
Last edited by steppenwulf (2010-02-13 09:47:41)
Offline
Thanks for all your help. Unfortunatly none of them did seem to work but then I was so stupid that I didn't think to make a volume slider so that's what i've done.
This thread can be locked since it has been resolved.
Offline