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

#1 2012-09-21 06:07:42

MissChamberlain
New Scratcher
Registered: 2012-09-21
Posts: 2

Sprites interacting with another Sprite

Hi all scratchers!  New to Scratch and learning as we go, my students and I are trying to develop a story based game where something happens when sprites interact with each other...

We can't work out which variables and controls to use!! Please can someone help!?

Help greatly appreciated, we will be contributing to the forums as we make our projects so please help us out

Offline

 

#2 2012-09-21 06:12:00

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Sprites interacting with another Sprite

You can use the

broadcast [thing v]
and
when I receive [thing v]
blocks.

If you broadcast something, every sprite will receive it.
More information: http://wiki.scratch.mit.edu/wiki/Broadcast

Last edited by meew0 (2012-09-21 06:12:14)


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#3 2012-09-21 06:58:33

MissChamberlain
New Scratcher
Registered: 2012-09-21
Posts: 2

Re: Sprites interacting with another Sprite

Thank you so much!!

Offline

 

#4 2012-09-21 08:16:26

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Sprites interacting with another Sprite

Another useful block is the "<touching []?> block".  If you want a sprite to only execute a certain action if/when it is touching another sprite:

when gf clicked
wait until<not<touching [character 1 v]?>> // not necessarily needed
wait until<touching [character 1 v]?>
broadcast [shake hand v]


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer