Home▸Physics & Mechanics▸Rigid-Body Physics Sandbox (2D)

Rigid-Body Physics Sandbox (2D)

A Canvas 2D bouncing-ball sandbox: tune gravity, bounciness and ball count, then click the stage to spawn more balls and watch real impulse-based elastic collisions play out between every pair.

Physics & Mechanics2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-elastic-collision-sandbox ↗ Open standalone

This 2D companion drives the same rigid-body mechanic as the 3D sandbox on a flat canvas: gravity pulls a set of variable-mass balls downward, each pair resolves its overlap and exchanges momentum through a real impulse-based elastic collision (scaled by an adjustable restitution coefficient), and walls bounce incoming balls back with the same coefficient — so tuning bounciness from near-dead to near-perfect elastic is immediately visible, and clicking the stage adds more balls to stress-test the collision pass.

⚙ Under the hood

Canvas 2D bouncing-ball sandbox with adjustable gravity, restitution and ball count, and real impulse-based elastic collisions between every pair of balls.

rigid bodycollisionelastic collisionrestitutiongravitymomentum

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)