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

#1 2008-07-30 14:24:43

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

repeat until block.

I think its acting up. i made a music variable.And its not responding right.

<when green flag clicked>
<forever>
   <if><( <{ music }> <=> 1 )>
       <repeat until><  <not> <( <{ music }> <=> 1 )> >>
         <play sound[ song
        <end>
   <end>
<end>

It responds by playing song when music equals another number.

Offline

 

#2 2008-07-30 15:23:26

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: repeat until block.

Are you sure it's not just ending the song from the previous time that Music=1 ?  It will take some time for the song to complete playing. While it is playing, it won't matter what value the variable has.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-07-30 15:31:27

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: repeat until block.

I fixed it.I switched the <( <{ music }> <=> 1 )>    and   <not> <( <{ music }> <=> 1 )> >> Around.

Offline

 

#4 2008-07-30 15:33:16

dingdong
Scratcher
Registered: 2007-08-09
Posts: 1000+

Re: repeat until block.

here's what I always do

[forever:
[play sound (music) until done]


another script somewhere else:

set music to (2)
stop all sounds   <-- this causes the music to stop immediately and restart music

all you have to do is assort the music properly
if you other things in the way you do this:

[forever:
[play sound ((music) + **) until done]

or

[forever:
[play sound ((music) - **) until done]

I use this in all my games and it seems to work the best of any functions


http://img851.imageshack.us/img851/2829/superanbanner.png
click the image for my music

Offline

 

Board footer