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

#1 2011-01-23 18:23:42

Hourken
New Scratcher
Registered: 2011-01-21
Posts: 6

Repeating music?

I have music loops loaded to my game but they only play once.  How can I make them keep repeating until a level ends and then switch to an new loop?

Offline

 

#2 2011-01-23 18:26:29

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Repeating music?

<when green flag clicked>
<forever>
<play sound[  ]and wait>

Last edited by ssss (2011-01-23 18:27:24)


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#3 2011-01-23 20:02:04

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Repeating music?

ssss wrote:

[blocks]<when green flag clicked>
<forever>
<play sound[  ]and wait>[/blocks]

Actually, he wants different levels and different songs.
<when green flag clicked>
<repeat until> <( <{ level }> <=> 2 )>
<play sound[ level 1 song ]
<end>
<stop all sounds>
<repeat until> <( <{ level }> <=> 3 )>
<play sound[ level 2 song ]
<end>
<stop all sounds>
[/blocks]
Repeat as necessary.

Offline

 

#4 2011-02-03 18:05:49

katstorm99
Scratcher
Registered: 2011-01-06
Posts: 100+

Re: Repeating music?

This helped.

Offline

 

#5 2011-02-04 12:32:54

henhouse05
Scratcher
Registered: 2011-02-04
Posts: 11

Re: Repeating music?

<when green flag clicked>
play sound () until done


This formula always seems to work for me. wink
PS. You need to wrap a forver block around the sound block!

Offline

 

Board footer