A WORKSHOP CREATION · SIMULATION

Bounce Lab

Drop some balls and change the rules while they are still falling. This is a simulation rather than a game: there is nothing to win, and the point is to change one number and be able to say what it did.

The simulation

This browser cannot draw a canvas, so the balls cannot be shown here. The measurements below still update.

900 px/s²

0.82

8

Running.

Balls
8
Average speed
0
Bounces
0

Four things to try

  1. Set Bounce to 1.00 and watch the average speed. The balls keep going and the number wanders around one value instead of falling away — nothing in this model takes energy out. It wobbles because a collision can hand most of one ball's speed to another, and that changes the average without changing the total.
  2. Now set Bounce to 0.60. Every ball settles on the floor within a few seconds. Each impact keeps 60% of the speed it arrived with, and 0.6 multiplied by itself enough times is nearly nothing.
  3. Set Gravity to 0. The balls drift in straight lines and rebound off the walls forever. That is what "no force acting" looks like, and it is also a decent test that your wall collision code is right.
  4. Push Balls to 24 and watch the frame rate. Every ball is compared with every other one, so the work grows with the square of the count. Twice the balls is four times the work.

What this model gets wrong on purpose

This is a teaching model, not a physics engine. Saying where a model stops being true is part of using one honestly.