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

#1 2010-09-01 18:44:46

egruna2
New Scratcher
Registered: 2010-08-31
Posts: 3

multi-level racing game help

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

 

#2 2010-09-01 18:47:47

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: multi-level racing game help

Upload the incomplete project and make a link to it here in your post.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#3 2010-09-01 18:51:39

ScratchGirl100
New Scratcher
Registered: 2010-08-17
Posts: 25

Re: multi-level racing game help

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.


http://i55.tinypic.com/s4c9z9.gif

Offline

 

#4 2010-09-01 21:26:54

egruna2
New Scratcher
Registered: 2010-08-31
Posts: 3

Re: multi-level racing game help

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

 

#5 2010-09-01 21:35:59

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: multi-level racing game help

If I understood you correctly, you're looking for a script like this:

Code:

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.  tongue

Last edited by Harakou (2010-09-01 21:36:57)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2010-09-01 21:37:36

egruna2
New Scratcher
Registered: 2010-08-31
Posts: 3

Re: multi-level racing game help

nvm i got it to work, ignore my last post

Offline

 

#7 2010-09-02 06:46:48

ScratchGirl100
New Scratcher
Registered: 2010-08-17
Posts: 25

Re: multi-level racing game help

Great  tongue

I'll have my volume off.


http://i55.tinypic.com/s4c9z9.gif

Offline

 

#8 2010-09-02 15:28:51

GlitchSprite
Scratcher
Registered: 2010-06-08
Posts: 1000+

Re: multi-level racing game help

I'm going to flag you for the image


http://www.mspaintadventures.com/storyfiles/hs2/02915.gif

Offline

 

#9 2010-09-03 00:56:18

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: multi-level racing game help

Maybe you should point out why as this appears to be a new Scratcher?


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer