I think it's a great way for get a non-programmer interested very quickly, but I personally was quite turned off when I clicked on the "realistic physics" based bouncing ball module and found that the ball doesn't actually stop bouncing, EVER.<p>The problem occurs in the following code:<p>if(ball.y + ball.radius > H) {
// First, reposition the ball on top of the floor and then bounce it!
ball.y = H - ball.radius;
ball.vy *= -bounceFactor;
// The bounceFactor variable that we created decides the elasticity or how elastic the collision will be. If it's 1, then the collision will be perfectly elastic. If 0, then it will be inelastic.
}<p>Basically, when the ball hits the ground (the collision check), it should no longer be receiving a gravity modifier as it's "on the ground". Additionally, because there's a user set velocity variable, there needs to be a check against the crest of bounce to slowly reduce that variable down to 0 so the ball will stay stationary.<p>Call me a stickler, but seeing a "physics" demo no matter how loosely it's based get stuck in an infinite bounce just rubs me the wrong way.