What it does
You describe each mover as data, a type, a width and the numbers that drive it, and createMovers builds them into
one set. The set follows the moving-surface contract from platform-map, so a platform-walker world steps it before
its bodies and carries whoever stands on each surface. A walker on a belt is pushed along it, a walker on a lift rises
with it, and a walker on an elevator platform is let off when that platform wraps from the top back to the bottom.
The movers are kinematic and fixed-step, with no randomness: every platform's position is a function of its timers. That makes a level repeatable for testing and replays, and the set snapshots and restores every phase and timer. The movers also run on their own as a timeline of platform positions, if you want them without walkers.
Drawing is yours. Each step pieces() gives every surface's position, width and visibility, a warning value for a
plank that is shaking or about to vanish, a swing's angle and pivot, and a belt's tread offset. Events such as
crumble-start, belt-reversed, elevator-wrap, arrived and disappear arrive through drain() for sounds and
effects.
Features
- Path platforms — ping-pong, closed loop or one-way trips along waypoints, with a dwell at each and an option to start only when a rider steps on.
- Looping elevators — columns of platforms moving up or down that wrap from one end to the other and release their riders as they do.
- Conveyors — belts with a speed and a direction that switches every few seconds, on a cycle of durations, or never.
- Swings — platforms on a pendulum arc that stay level, with amplitude, period and phase.
- Crumbling platforms — shake under a rider, drop or vanish after a delay, and respawn after a time or not at all.
- Timed platforms — blink on and off on a timetable with a warning before they go.
- Static ledges and surface flags — fixed add-on ledges, and on any mover solid undersides, traction, spring pads and hazards.
- Runtime control — reverse, change speed, enable, trigger, reset, add and remove movers while the game runs.
- Render state and events — positions, warnings, rope angles and belt travel each step, and events for every change.
Good for
- Ladder-and-girder stages in the style of Donkey Kong, with looping elevators and conveyors that switch direction.
- Single-screen platformers with lifts, shuttles and spring pads between ladders.
- Precision platform rounds with crumbling bridges, blinking steps and swings over a pit.
- Level prototyping, since every mover's numbers are plain data that can be tuned live while you play.
- Puzzle levels with a lift that waits for its rider to carry them up to a bar or ledge.
Make it yours
createMovers takes a list of definitions, and every behaviour is per-definition data: the path's points, speed,
mode, dwell and trigger; an elevator's column, ends, speed, platform count and direction; a belt's speed and switch
timetable; a swing's pivot, rope length, amplitude and period; a crumble's delay, fall style, gravity and respawn time;
a timed platform's on, off and warning times. Every mover also sets its thickness and whether it is solid, has
traction, acts as a belt or spring, or hurts.
Two quite different uses: a girder stage with three elevator platforms rising up a shaft and a conveyor that reverses every three to five seconds; or a custom platform level with a swing over a pit, a shuttle between ladders, a rider-triggered lift and a four-plank crumbling bridge.
A quick look
A shuttle, an elevator, a belt, a swing and a crumbling step, added to a walker world:
const movers = game.platformMovers.createMovers({ movers: [
{ id: 'ferry', type: 'path', width: 24, points: [{ x: 98, y: 48 }, { x: 334, y: 48 }], speed: 30, dwell: 1, mode: 'ping-pong' },
{ id: 'up', type: 'elevator', width: 20, x: 76, top: 36, bottom: 232, speed: 20, count: 3, direction: 'up' },
{ id: 'belt', type: 'belt', width: 48, x: 128, y: 208, speed: 30, switchEvery: [3, 5] },
{ id: 'swing', type: 'swing', width: 24, pivot: { x: 240, y: 140 }, length: 80, amplitude: 0.55, period: 3.4 },
{ id: 'step', type: 'crumble', width: 16, x: 290, y: 192, delay: 0.5, respawn: 3, fall: 'drop' },
]});
world.addProvider(movers);
for (const p of movers.pieces()) drawPlank(p.x, p.y, p.width, p.warn, p.angle, p.beltOffset);
Works with
platform-walker— the bodies that ride the movers; the world steps them first.platform-map— the static level, and the surface contract the movers follow.platform-enemies— enemies ride movers like any body, and an idle kind becomes an item carried on a belt.platform-rounds— runs the game on top, including whether being carried into a ceiling is a crush.girder-climb— girder stages that use its conveyors and elevators.platformer-2d— for physics traversal with joints and generated courses.
Good to know
- Surfaces are horizontal top edges: they carry riders and can stop heads, but do not push bodies sideways or collide with each other or the map.
- Swings stay level and their rope never collides; there is no tilting platform or seesaw.
- Paths are straight lines between points, so a curve needs more points.
- An elevator column holds at most 64 platforms, and a set at most 1,024 movers.






