Hello. I'm trying to create a multi-level racing game for my computer science class, but im having trouble with getting it to switch levels. I want it to change to the next stage when my "sprite" touches the finish line (Im assuming "when color _ touches color _" is the way to do this?) but i cant seem to find a way to do this using either the stage, or sprite scripts. Any suggestions would be greatly appreciated.
I imagine it would look something like:
If color _ is touching _
play sound ___
switch to background ___
but the only problem with this is you cant switch backgrounds, or use the color touching scripts in the sprite or stage scripts respectively.
Offline
Try making a separate sensor, and set it's ghost effect to 99.
Then tell it to go to your car sprite forever.
Go with:
<when green flag clicked>
<forever>
<if><touching color[ color of finish line ]>
<play sound[ Hooray I won ]>
<broadcast[ Next Stage ]>
<end>
<end>
Stage:
<when I receive[ Next Stage ]>
<next background>
Like that.
Offline
alright i managed to work that problem out, thanks to ScratchGirl100, but now ive run into another problem. The point of the game is to get to the end, and at the end it will flip to a picture and a screaming sound clip (like those screamer videos on youtube) to scare my professor...and hopefully impress him enough to get a good grade... anyways, when i get to the end it plays the screaming clip, but it cycles through all of the stages/pictures back to the home screen, instead of staying on the picture of the screamer. any help is appreciated.
http://scratch.mit.edu/projects/egruna2/1276229
Offline
If I understood you correctly, you're looking for a script like this:
When I receive [win] broadcast [scream] and wait repeat until < (background #) = 1 > switch to background [(background #) - 1] EndRepeat
Hope that's what you wanted!
P.S. I hope your teacher takes jokes well.
Last edited by Harakou (2010-09-01 21:36:57)
Offline