workshop

← all creations

Grapple Swing

mechanics · created 2026-08-22

Grapple-hook swing mechanic — rope constraint turns momentum into a pendulum arc, release to sling free.

movementphysicscanvas

A grapple-hook mechanic: fire a rope at an anchor point and free-fall becomes a pendulum swing. Reel the rope in or out mid-swing to trade arc for height, and release at the top of the arc to sling off with full momentum. The demo is a small gap-crossing arena — three girders strung across a pit, cleared by chaining swings rather than jumping.

Reuse

The mechanic lives in src/grapple-swing.js as a framework-free ES module:

The core swing step: once attached, if the distance to the anchor exceeds ropeLength, the position is projected back onto that circle and the outward-radial component of velocity is stripped, leaving only the tangential component. That’s the whole pendulum — no trig, no rope segments.

Port notes for DragonRuby: update() is ~30 lines of pure state math with no DOM dependencies — translate directly into a tick method; the rope draws as one line primitive from anchor to pos.

Gotchas