ScratchData LogoScratchData
Back to Canthiar's profile

Bouncing Balls

CACanthiar•Created May 26, 2007
Bouncing Balls
159
140
8594 views
View on Scratch

Description

You can move the object emitter around with the mouse and change the direction by clicking on the pointed end. This is what I consider a production version since I've inlined a few things. I have a more academic version that is a little easier to read. The whole thing is also dumbed down a little to make the math a little easier. How it works: When a ball encounters a collision object it uses the [ point towards[ Collision ] ] command block and then uses sin and cos to calculate a colliion normal. That normal is used to calculate a resulting velocity perpendicular to the surface and velocity tangent to the surface. Friction and restitution are applied to make the ball bounce.

Project Details

Project ID7369
CreatedMay 26, 2007
Last ModifiedApril 21, 2023
SharedMay 26, 2007
Visibilityvisible
CommentsAllowed