Home▸Physics & Mechanics▸Marble Run: Friction & Gravity Test (2D)

🧪 Marble Run: Friction & Gravity Test (2D)

Beads roll along a closed, hilly 2D track under tangential acceleration computed straight from the local slope, a tunable gravity constant and a rolling-friction coefficient — push friction high enough and a marble genuinely stalls before it crests the next hill.

Physics & Mechanics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-marble-run-friction-gravity-test ↗ Open standalone

This 2D companion swaps the 3D scene's spiraling tube for a plain top-down view of a closed, hill-modulated loop so the underlying mechanics are the whole point: every marble is a bead-on-wire whose speed along the track updates each fixed step from dv/dt = g·sin(φ) − μ·g·cos(φ)·sign(v), where φ is the track's local slope angle at the marble's position. Raise the rolling-friction slider and lower the gravity multiplier together and a marble can lose all its speed partway up a hill — it stalls in place, greyed out on the readout, until the balance between gravity and friction tips back in its favor. A hill-intensity slider reshapes the track live (rescaling every marble's arc-length position to match), and the readout panel tracks active marble count, average speed, elapsed time, completed laps and how many marbles are currently stalled.

⚙ Under the hood

2D marble-run lab: beads roll along a closed hilly track with tangential acceleration computed from real slope, gravity and rolling-friction terms — raise friction enough and a marble stalls on the hill instead of just slowing down.

Marble RunGravityFrictionTangential Dynamics

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

What did you find?

Add reproduction steps (optional)