What it does
You author a level as rows of text through a legend, # solid, = platform, H ladder, - bar, ^ hazard and so
on, or as cell data, at any size and tile size. Legend entries can carry named markers, so the player's start, enemy
spawns, items and the exit come straight out of the map. For girder levels, girderMap turns sloped girder lines and
ladder lines into a map whose slopes become one-unit stairs, with ladders running between the girders they meet and
broken ladders where you mark them.
The map then answers the questions every step of movement and AI asks: which standing line a foot crosses, what a
rising head hits, where a body's walls are, where the ladders and bars run, whether a stretch is walkable. route
plans a deterministic path over walks, climbs, hangs, falls, drops and jump-ups through one-way platforms, which is
what lets enemies chase the player up and down a level.
Levels change while you play. Digging a hole, refilling it, breaking a block, removing a rivet or turning a floor to ice each bumps a revision and records a change event with its cause, which you can read, drain or listen to. Walkers re-query every step, so an edit takes effect at once, and pursuers re-plan when the revision moves. The pack has no movement and no game rules of its own.
Features
- Cell kinds — solid blocks, one-way platforms, ladders, broken ladder gaps, bars, hazards, and solid blocks a rising body passes through from below.
- Materials and tags — diggable and breakable cells, named materials such as ice, and free tags such as rivets or traps that your rules own.
- Stepped and sloped floors — standing surfaces lowered within a cell, for stepped girders and slopes.
- Text-row authoring — a default legend you can extend, with named markers for starts, spawns, items and exits.
- Girder levels —
girderMapbuilds a map from girder and ladder lines, slopes and broken ladders included. - Wrapping — either axis can wrap, with every query and distance wrapping too; other sides are walls or open.
- Movement queries — support below a foot, ceilings above a head, wall sweeps, ladder runs, bars, hazards and walkable stretches.
- Routes — breadth-first paths over walk, climb, hang, fall, drop and jump-up moves, with limits on fall height and jump-up rows.
- Runtime edits with a log — dig, refill, break, set and material changes, each recorded with a revision and a cause.
- Moving surfaces contract — the
SurfaceandSurfaceProvidershapes that lifts, belts, bubbles and snowballs implement, so walkers stand on them all the same way.
Good for
- Ladder-and-girder games in the style of Donkey Kong, from girder lines with stepped slopes, broken ladders and rivets.
- Dig-and-chase puzzles in the style of Lode Runner, with bars, diggable bricks and holes that refill.
- Single-screen wrap-around arenas in the style of Mario Bros or Bubble Bobble, with side wrap, vertical wrap and jump-through floors.
- Dig-a-hole platformers in the style of Space Panic, where floors are dug and ladders join the levels.
- Platform mixes of your own, bars over a conveyor, ice floors and spikes, or tunnels dug beside ladders.
- Level editors, since the map prints itself back to text rows and reports every change.
Make it yours
Everything is the map definition: the rows or cells, the legend, the tile size (square or not), the origin, wrapping on each axis, whether the sides, top and bottom are walls or open, whether a ladder's top cell counts as floor, and how much change history to keep. The legend is yours to extend, a new character for a tagged rivet or an ice platform is one line.
The same model serves very different levels. A 224 by 256 girder stage built from sloped girder lines, with stepped standing heights and a broken ladder, is one; a Lode Runner-style brick grid with bars, diggable bricks that become holes and refill, and routes that drop through dug cells, is another; a wrapping single-screen arena with one-way platforms that bodies jump up through is a third.
A quick look
A map from text rows with an extra rivet character, a support query, a route and a dug hole:
const map = game.platformMap.createPlatformMap({
rows: levelRows, // e.g. ['..*.....H..', '=======h===', …]
legend: { ...game.platformMap.defaultLegend(), R: { platform: true, tag: 'rivet' } },
tile: 8, wrapX: false, wrapY: false, bounds: { bottom: 'open' }, ladderTopFloor: true,
});
map.supportBelow(x, fromY, toY, { span: 3 }); // { y, col, row, kind, material, oneWay } | null
map.route({ col, row }, { col: tc, row: tr }, { climb: true, hang: true, fall: true, jumpUp: 0 });
map.dig(col, row); map.refill(col, row); // revision++, change recorded, listeners called
Works with
platform-walker— moves bodies over the map, querying it every step.platform-movers— lifts, conveyors and other moving surfaces through the contract defined here.platform-enemies— enemy pursuit planned withroute.platform-rounds,enemy-capture,dig-trap— rule packs that dig, refill, remove rivets and freeze floors.platformer-2d— for physics traversal courses rather than arcade platforming.excavation— for top-down tunnelling games.
Good to know
- Maps are at most 4,096 by 4,096 cells, with up to 65,535 distinct materials or tags.
- A cell is one tile: apart from lowered standing surfaces there are no sub-tile solids, and solid cells block from the side whatever their lift.
- Routes cost time in proportion to the cells searched, assume a walker one cell tall, and do not see moving surfaces.
- It holds no rules: whether a hazard kills, what a rivet is worth and how long a hole stays open belong to rule packs.






