Code and Gravity

Every escape spawns 3 balls

Every ball that escapes the ring is replaced by 3 new balls, so the number of balls snowballs until there are 70 inside.

How it works

One ring with a rotating gap holds the balls. Each escape adds 3 new balls, so growth speeds up: more balls means more chances to find the gap. The balls also collide with each other. The video ends when 70 balls are inside, then resets to loop.

Questions

Why does the ball count grow faster over time?
Each escape adds 3 balls and removes one, and more balls hit the gap more often, so the growth feeds itself.
Is this real physics or an animation?
It is a physics simulation. Collisions are computed 60 times per second from gravity, velocity and bounce rules, then drawn. Nothing is hand-animated.
Will it look the same every time?
Yes. Each video uses a fixed random seed, so the same run plays identically every time, on this site and in the video.
Watch on YouTube →

More like this