This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-12-21 17:22:12

Metamorphist
New Scratcher
Registered: 2012-12-21
Posts: 1

Music track help

Hey guys, I'm having trouble getting a setup for a game that I am creating in which I have a soundtrack looping infinitely until the player looses. I can get the track to loop by scripting (When Pressed) (Repeat Until { }) (Play sound until done) but I can't get it to stop no matter what trigger I put in. Can anyone help me with this?

Offline

 

#2 2012-12-21 18:48:14

mmww
Scratcher
Registered: 2010-01-14
Posts: 500+

Re: Music track help

Yes I can help


when gf clicked
forever
play sound (music) until done
when gf clicked
forever
if (dead/alive=dead)
stop all sounds


http://i.imgur.com/AWFFO.pnghttp://www.weebly.com/uploads/1/0/1/4/10146167/4363061_orig.png Save the cheese!
I am http://blocks.scratchr.org/API.php?action=onlineStatus&user=mmww

Offline

 

#3 2012-12-22 01:45:33

Ideas
Scratcher
Registered: 2012-10-07
Posts: 100+

Re: Music track help

Instead of stopping the song, you can mute it.

 
when gf clicked
set volume to [100]% 
forever
play sound [my looped sound v] until done
end
when gf clicked
set [mute v] to [0]
forever
if <key [space v] pressed?>
if <(mute)=[1]>
set volume to [0]%
set [mute v] to [0]
wait until <key [space v] pressed?>//so that it wont glitch out
end
if <(mute)=[0]>
set volume to [100]%
set [mute v] to [1]
wait until <key [space v] pressed?>//so that it wont glitch out
end

Last edited by Ideas (2012-12-22 01:49:24)


http://img685.imageshack.us/img685/2010/screenshot20121110at132.pngI think that you must CLICK above

Offline

 

Board footer