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

#1 2012-03-24 21:14:08

danielson123
New Scratcher
Registered: 2011-02-27
Posts: 1

How do i make something bounce off of another sprite

I need a answer really quick b/c my project is due next week.
How do you make a sprite bounce off of another sprite: it either goes in front or behind the sprite, even though i change the layers. Can you help pleeeeeeeeeease?

if < touching [sprite] >
    change y by (40)
    turn (15) degrees
end

Offline

 

#2 2012-03-24 21:34:13

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How do i make something bounce off of another sprite

Well, in most of the pong games here, it uses this:

if <touching [sprite v]?>
turn cw (180) degrees
turn cw <pick random (-30) to (30)> degrees
end

Last edited by ImagineIt (2012-03-24 21:36:27)

Offline

 

#3 2012-03-24 21:34:53

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: How do i make something bounce off of another sprite

Could you please upload your current project and post a link here?

Offline

 

#4 2012-03-24 21:36:31

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

Re: How do i make something bounce off of another sprite

It depends.  Are you changing its position with the "change x" and "change y" blocks, the "go to x: ( ) y: ( )" block, or the "move () steps" block?

Last edited by MoreGamesNow (2012-03-24 21:36:58)


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

Offline

 

Board footer