What it does
Every body is an axis-aligned box over a platform-map level. You set its intent each step, a horizontal and a
vertical direction and a jump, and the world moves it by its profile. Because input is just intent, a keyboard, a
recorded replay, a test bot and the enemy director all drive bodies the same way, and an enemy can share a profile
with the player.
A profile is the whole feel of a character. Walking is instant or has acceleration, deceleration and a skid on turning. A jump is none, a fixed arcade arc that commits to its direction, or a variable jump you can cut short, with coyote time, input buffering and air steering if you want them. Falls accelerate or drop at a constant rate, can be fatal past a height measured from the apex or the take-off, and can glide to a column's centre so a body drops cleanly into a one-cell hole. Ladders have rules for where you can get on and off, whether broken rungs block, and whether you can grab one in the air; bars are caught by walking or falling into them.
The world is also the stepping hub of the platform packs. Moving-surface providers step first, controllers think,
bodies move, sensors refresh, and controllers sense. Riders are carried by lifts and pushed by belts, and the crush
rules are careful: a deck passing beside a walker never hurts it, and an embedded event names its cause so a game
can treat only real crushes as deaths. Horizontal moves are substepped and vertical sweeps cover every row crossed, so
nothing tunnels at any speed.
Features
- Walking — instant or momentum, with acceleration, deceleration, a turning skid, step-up and step-down, and edge policies to walk off or stop.
- Jumps — fixed arcade arcs, keep-momentum jumps or fully controlled variable jumps, with jump cuts, coyote time, buffering, wall bounces and jumps from ladders and bars.
- Falls — accelerating or constant, with a top speed, a fatal height, bounces and centring for grid games.
- Ladders and bars — entry within a snap distance, exits at the ends or anywhere, broken rungs, grabbing in the air, stepping off sideways, and hand-over-hand bars with drops.
- Screen wrap and drop-through — wrap on either axis, down and jump to drop through one-way floors, and blocks a rising body passes through from below.
- Flight and materials — flying bodies, and per-material traction, acceleration and speed for ice.
- Moving surfaces — riding lifts, being pushed by belts and dropped by crumbling planks, with a careful crush policy.
- Stun, knock and teleport — generic states for rule packs, plus bodies others can stand on.
- Sensors for AI — wall and edge ahead, ladders above and below, a bar here, the current cell and what was hit.
- Events — jumps, landings with fall height and fatality, head bumps with the cell, wraps, hazards, embeds and leaving the screen.
- Presets —
jumpmanProfile,marioBrosProfile,bubbleBobbleProfile,snowBrosProfile,lodeRunnerProfile,spacePanicProfileandlabPlayerProfile, scalable to your tile size.
Good for
- Ladder-and-girder games in the style of Donkey Kong, with a fixed jump arc, fatal falls and ladders entered only at their ends.
- Single-screen wrap-around games in the style of Mario Bros or Bubble Bobble, with momentum, head bumps, jump-through floors and wrap.
- Dig-and-chase puzzles in the style of Lode Runner, with constant falls, bars and sideways ladder exits.
- No-jump climbing games in the style of Space Panic, where the player only walks and climbs.
- Your own platform hero, mixing a profile's walk, jump and climb rules on a custom level.
- Enemy movement, since enemies are bodies with profiles of their own.
Make it yours
Everything is per-body profile data, and walkerProfile merges your changes over a base, so a new character is a
few overrides of a preset. The presets are built for 8-unit tiles at 60 steps a second and scale to your tile size.
The world itself takes the map, any moving-surface providers and controllers, the step length and a cap on steps per
tick.
Two quite different feels from the same pack: a girder climber with a fixed jump arc, no air control, a fatal fall measured from the take-off and ladders it can only enter at their ends; or a momentum hero on a wrapping screen with variable jumps, a skid on turning, icy floors and head bumps that a rule pack turns into enemy flips. A Lode Runner profile can even ride a girder game's conveyor under a bar, because every body reads the same level.
A quick look
A world over a map and its movers, one player, and the frame loop:
const world = game.platformWalker.createWalkerWorld({ map, providers: [movers], step: 1 / 60 });
world.add({ id: 'player', x, feet, profile: game.platformWalker.jumpmanProfile(), tags: ['player'] });
world.setIntent('player', { x: -1, y: 0, jump: true });
world.tick(dt); // whole fixed steps; or world.step()
for (const e of world.drain()) { /* jumped, landed {fall, fatal}, bumped {col,row}, wrapped, hazard, embedded ... */ }
const b = world.body('player'); // x, y (centre), feet, vx, vy, facing, mode, support, sensors ...
Works with
platform-map— required: the level the bodies move over; edits take effect on the next step.platform-movers— lifts, belts, crumbling planks and elevators as moving surfaces.platform-enemies— the enemy director, a controller that sets enemy intents.platform-rounds,dig-trap,enemy-capture— rule packs that read the events and decide what they cost.platformer-2d— for physics traversal courses with slopes, joints and generated courses.
Good to know
- Bodies are boxes that do not rotate or collide with each other; use the overlap and query calls for contact rules.
- Surfaces collide from above, and with solid undersides from below, never from the side.
- A world holds at most 4,096 bodies.
- Preset speeds are frame-analysis figures where published and judged from play otherwise.
- No rules: a fatal landing, a hazard or a crush is an event, and the game decides what it costs.






