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

#1 2011-11-20 20:12:01

gdm123467
New Scratcher
Registered: 2011-11-20
Posts: 1

my two sprites wont register them touching?

I'm trying to make the sprites touch each other and have an effect when that happens. But when i move them close one just slides behind the other. Does anyone know how to fix this?

Offline

 

#2 2011-11-20 20:52:01

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: my two sprites wont register them touching?

That is normal.
To have the effect, just use this.
when green flag clicked
if touching sprite2
carry out effect


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#3 2011-11-20 22:26:40

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

Re: my two sprites wont register them touching?

Well, Scratch has layers, so that sprites will appear to be above or below another one depending on the layer it's in. You can adjust these layers with the [go to front] and [go back x layers] blocks.

As a slight modification to SJRCS_011's script (assuming you want this affect to occur whenever they touch)

Code:

When green flag clicked
forever
    if touching sprite2
        [effect]
        wait until not touching sprite2

This also belongs in All About Scratch, so I've moved it there for you.


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

Offline

 

Board footer