SPACE / tap = release or grab | R = restart | D = demo
Gibbon Swinger
A physics-based brachiation simulator — swing hand-over-hand through the rainforest canopy
How to play
Gibbons brachiate by swinging beneath branches, releasing at the right moment to fly forward and grab the next branch. Your job is to time the releases and grabs.
Press SPACE or tap/click while swinging to release and fly forward.
Press again in mid-air to grab the nearest reachable branch (highlighted in blue).
Release near the bottom of the swing for maximum horizontal speed. Release higher for a longer arc at the cost of some speed.
Branches get farther apart with distance — timing becomes more critical at higher scores.
Controls
Keyboard
SPACE — release or grab R — restart D — toggle demo mode
Mouse / touch
Click or tap anywhere on the canvas. Full pointer-event support for touch screens.
Demo mode
Auto-starts after 10 s of inactivity. The AI releases optimally near the swing bottom. Click anywhere to reclaim control.
Sound
Off by default. Toggle with the button. Web Audio synthesises swing whooshes and branch-grab pluck sounds.
Physics model
All positions live in world coordinates. The camera follows the gibbon with a fixed look-ahead. Three key equations drive everything:
Pendulum:α = −(g/L)·sinθ where θ is the angle from vertical. Semi-implicit Euler integration each frame.
Release: tangential velocity at arm tip — vx = ω·L·cosθ, vy = −ω·L·sinθ. Then projectile motion (vy += g) until the next grab.
Grab: linear velocity projected onto the new tangent — ω = (vx·cosθ − vy·sinθ) / L. This conserves physical momentum across the transition.
Biological accuracy
Gibbons (family Hylobatidae) are the fastest non-flying arboreal mammals, reaching 55 km/h. Key brachiation facts modelled here:
A brief flight phase between each grab — modelled as a parabolic arc.
Ball-and-socket shoulders allow 360° rotation — the pivot point models this freedom.
Optimal release is at the swing bottom (maximum tangential velocity, near-horizontal direction) — exactly what the AI does.
Future directions
Momentum pumping — active arm extension at the bottom of the swing to inject energy.
Multi-segment flexible arm using a Verlet chain instead of a rigid rod.