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

#1 2012-05-08 09:51:12

Lilhardy94
Scratcher
Registered: 2012-04-12
Posts: 25

bounce function

ok there is an easy if touching edge bounce function bt is there a way to make a if touching sprite bounce function?

Offline

 

#2 2012-05-08 11:36:06

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: bounce function

when gf clicked
forever
wait until <touching [sprite v]?>
turn right (180) degrees
wait (1) secs


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

#3 2012-05-08 12:43:36

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: bounce function

Take a look at the Wiki. This script is more complex that shpeters with the inclusion of trig laws, but still easy to implement even if it's more difficult to understand  smile


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#4 2012-05-08 13:57:02

shpeters
Scratcher
Registered: 2011-12-11
Posts: 100+

Re: bounce function

That script is works but so does mine, although the wait script may have to be changed to be longer. An example of it working can be seen here. (The ball's reaction to the red).


http://i.imgur.com/bboYO.pnghttp://i.imgur.com/66Yki.gifhttp://i.imgur.com/uLUsl.jpg

Offline

 

#5 2012-05-08 18:46:44

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: bounce function

The answer can be found here. Good luck!


http://i47.tinypic.com/2iaa73k.png

Offline

 

Board footer