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

#1 2011-01-08 18:47:00

coblet
New Scratcher
Registered: 2010-12-28
Posts: 2

how to bounce off something that is not an edge?

how would you prevent a sprite from going past a color or object that is in the middle of the field?
thanks.

Offline

 

#2 2011-01-08 20:15:41

Marioblender
Scratcher
Registered: 2010-04-04
Posts: 31

Re: how to bounce off something that is not an edge?

You could look here: http://scratch.mit.edu/forums/viewtopic … 77#p544777
The block <if touching sprite bounce> on that link works only with sprites, not colors.

Offline

 

#3 2011-01-08 20:46:19

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Re: how to bounce off something that is not an edge?

Try using scripts like this:  smile

Colour Sensing

http://i404.photobucket.com/albums/pp129/06dknibbs/Wall.gif

Note: The colour being used in this script is black, although you can change it to anything.

[u]Sprite Sensing[/i]

http://i404.photobucket.com/albums/pp129/06dknibbs/Wall2-1.gif

Click the images to view them fullsize if they're blurry.  smile

Last edited by 06dknibbs (2011-01-08 20:53:03)


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#4 2011-01-08 21:26:13

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: how to bounce off something that is not an edge?

^^ Yeah, O6dknibbs has the correct scripts, but you can use other possible ways, too. Instead of changing x by 6 if touching sprite2, I just use change x by 5, the opposite number of -5, so you won't go that far off.


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

Board footer