What it does
Runners of different colours race across floors joined by staircases to a finish platform. Each floor has bricks of every colour. A runner picks up its own, and any loose ones, into a stack, and each new step it climbs must be its colour or take a brick to become so. With no bricks left it can climb no further and has to go back down for more; going down is free. Picked bricks come back after a few seconds, and a colour's bricks only appear on a floor once its runner has reached it, so leaders cannot hoard what is ahead.
On a floor, two runners touching compare stacks. The smaller one falls, drops its bricks around it for anyone to take and lies down for a moment, then cannot be knocked again for a second more; equal stacks bounce off. That one rule gives the race its push and pull: a tall stack is both a way up and a threat.
The rivals play the same rules. They collect until they have enough for the staircase that needs fewest of their bricks,
climb it, come back down when they run out, run from bigger stacks and knock smaller ones. How often they think again
follows a skill setting. game.suggest(id) returns the way a rival would go for any runner, and the autopilot uses it
to play the player's runner for an attract mode or a test.
The pack is pure rules. You call move with the stick and step with the frame time; the race advances in fixed steps
of 1/60 s and reports what happened as events: a brick picked or laid, a runner blocked, a floor reached, a knock, the
finish. It draws nothing, so the same race can be a 3D scene, a top-down view or a test with no screen.
Features
- Collect, carry and lay — bricks of your colour stack up to a carry limit, and one is spent on each step that is not already yours, covering a rival's colour if need be.
- Knocks and loose bricks — the smaller stack falls and scatters its bricks for anyone, with a stun time and a second's grace afterwards.
- Rivals that race — they pick the cheapest staircase, climb, retreat when empty, avoid bigger stacks and chase smaller ones, with a skill from 0 to 1.
- A course from a seed — floors, staircases, steps, sizes and brick spots laid out by
planCourse, with up to twelve floors and the brick spots scattered on a jittered grid. - One to eight runners — the player's first, each with a colour and a name.
- Events —
pick,lay(with the colour it covered),blocked,floor,knock(with how many bricks fell),finishandend, for sounds, effects and the HUD. - Every step's colour — the state lists each staircase's steps by colour, and each runner's height, floor, stack and place.
- Autopilot — plays any runner as the rivals do, for attract modes and tests.
- Snapshot and restore — the whole race as plain JSON, and a restored race plays on exactly as the original.
- Checked options —
validateBridgeRacelists every fault, one line each, andcreateBridgeRacerefuses options that do not fit, such as staircases wider than a floor.
Good for
- Hyper-casual stack-and-build races in the style of Bridge Race, with a joystick and rivals of every colour.
- Party races against bots, where up to eight runners share one course.
- Games where a carried resource is spent to make the way forward, such as paving, bridging or ladder-building races.
- Short mobile levels, where floor and staircase counts set how long a race lasts.
- Attract modes and playtests, driven by the autopilot without a player.
Make it yours
createBridgeRace takes the seed, the number of players and their names, run and climb speeds, how long picked bricks
take to come back, the most a runner can carry, whether knocking is on, the stun time and the rivals' skill. The course
is its own set of options: how many floors, how many staircases between floors, steps per staircase, floor width and
depth, staircase length, width and rise, and brick spots per colour on each floor. Leave any of it out and
courseDefaults fills it in.
Two quite different races from the same pack: the default, four runners over three floors of three staircases of fourteen steps; or a short, tall sprint of one long staircase per floor, small carry limits so every runner keeps going back for more, and knocking off for a calmer race against gentle rivals.
A quick look
A race on the game, steered by a stick, with runners and staircases drawn from the state:
const race = game.collectBuild.create({ seed: 2, players: 4 });
race.move(stick.x, -stick.y); // y is up the course
race.step(dt);
for (const r of race.state.runners) drawRunner(r.colour, r.x, r.z, r.y, r.stack);
race.state.steps.forEach((steps, i) => drawStair(race.course.stairs[i], steps));
Works with
crowd-runner— for a crowd run through gates rather than a brick race.consume-grow— for a game where you swallow a city and grow.
Good to know
- Runners are circles on flat floors, and staircases are straight and run up the course.
- Runners pass through one another on staircases; knocks happen only on floors.
- The race ends when the first runner reaches the finish.
- The pack draws nothing: your game draws the runners, stacks, steps and bricks from the state.






