Well, as my topic says, I can't get the music to change on my game. Right now, I have a screen variable which changes when you hit the edge. I want the music to change when the variable is at a certain number. However, to get the music to loop, I have had to put is as a play until done loop. This means that the script doesn't check for the screen changes until the 2 minute song finishes, or until I manually restart the loop, in which case it does check. Can somebody offer me a suggestion? The code is on my Hero sprite if you want to look at it here: http://scratch.mit.edu/projects/fullwall/750506
Last edited by fullwall (2009-11-08 08:28:08)
Offline
you want it so if you touch a wall a music loops right?
Offline
Bump. Basically what I need is a script that loops music until the variable is a certain value, in which case it changes to a different song. As I said earlier, if I just put a stop script inside an if block, it doesn't check if it's true.
Offline
<Forever> <if Variable = 1> Play sound Wait until Not Variable = 1 Stop all Sound End If <if Variable = 2> Play diff. Sound Wait until Not Variable = 2 Stop all sound End if End forever
Do this as much times for each diff. peice of music needed. If it doesnt work, tell me.
Regards,
Ralphjos
Edit: The <end if> isnt a block, its the little thing after the if is finished, this goes for all of the Ends:
<end>
Last edited by Ralphjos (2009-11-09 04:41:58)
Offline
two scripts
<when green flag clicked>
<forever>
<if><( <{ variable }> <=> 1 )>
<stop all sounds>
<play sound[ sound1 ]and waits>
<end>
<end>
[/blocks]
and
<when green flag clicked>
<forever>
<if><( <{ variable }> <=> 2 )>
<stop all sounds>
<play sound[ sound2 ]and waits>
<end>
<end>
[/blocks] Put both those scripts on the same sprite
Offline