What it does
The chicken hops one cell at a time, forward, back or sideways, and lands on a column or, on a log, wherever it is carried. Trees, the edges and anything behind the start stop a hop with a bump; water does not, so a hop into the river is the player's own mistake. Cars, trucks and trains kill, even mid-hop. A log can carry the chicken off the edge. Stand still too long, or fall behind the slowly creeping screen, and the eagle comes. The furthest row reached is the score, and coins collected are counted too.
The strip is data. Row kinds are named records: grass with a chance of trees and coins, a road with a vehicle count,
speed, gap and the vehicle pieces to draw from, a river of logs or of lily pads, and a railway with a train period, a
warning time, a length and a speed. Ranges are picked per row by seed. Segments string rows together and are chosen by
seed among those allowed at that distance, by weight and by what may follow what, so a strip can open gently and grow
harder further on. Neighbouring moving rows flow opposite ways, and the moving rows themselves are lane-control lanes.
Rows are generated as the chicken nears them, so the strip never ends and never has to be stored; a snapshot holds only
the run, because the rows follow from the seed. The game advances in fixed steps of 1/120 s and reports events for each
hop, bump, landing, new furthest row, coin, railway bell and the cause of the end: car, train, water, drift or
eagle.
Features
- Hop on a grid — four-way hops with a hop time, blocked by trees and edges, carried by logs and hit in the air.
- Four row kinds — grass with trees and coins, roads of traffic, rivers of logs or lily pads, and railways with warning lights and a bell.
- A row grammar — row kinds by name and segments chosen by seed, weight, distance and what may follow what.
- An open path — a path through the grass is kept clear of trees, and a pond of lily pads always has a pad on it.
- The eagle — a limit on idle time, a creeping screen line and a distance behind it, all options.
- A view for any renderer — rows, movers, trains, flashing warnings, the chicken and an overhang where traffic runs on out of reach.
- Events —
hop,bump,land,forward,coin,bellandoverwith its cause, for sound and effects. - Route-searching autopilot — searches a copy of the crossing for the quickest route to the next grass row and plays it exactly, for attract modes and tests.
- Snapshot, restore and clone — the run as plain JSON, and a copy at the same point for look-ahead.
- Checked options —
validateCrossyRoadlists every fault in the options, row kinds and segments.
Good for
- Endless hopping crossers in the style of Crossy Road, drawn as voxels or in any style you like.
- Highway-and-railway dodgers where the traffic is the whole game, by weighting the strip towards roads and rails.
- River hoppers, with long stretches of logs and lily pads.
- Short mobile sessions where the score is the distance and the eagle keeps runs moving.
- Themed reskins, such as a city, a farm or space lanes, since the pack draws nothing and every row kind is data.
- Attract modes and difficulty testing, with the autopilot playing the strip.
Make it yours
createCrossyRoad takes the seed, the width in playable columns from 3 to 40, the overhang either side, the row kinds,
the segments and the opening sequence, the hop time, the chicken's half width, the eagle's idle limit, creep and
distance, and a pace factor for everything that moves. Row kinds and segments replace the built-in crossyRows and
crossySegments whole, or you can build on them.
Two very different games from one pack: the built-in strip, nine columns of meadows, highways, streams, rapids, ponds and railways that grow harder further on; or a narrow, frantic railway run of seven columns, its segments weighted towards rails with short warnings and long trains, a faster pace and an eagle that creeps sooner.
A quick look
A crossing driven by the arrow keys and drawn from the view:
const run = game.crossyRoad.create({ seed: 7 });
if (game.input.keyPressed('ArrowUp')) run.hop('up');
run.step(dt);
const v = run.view();
for (const r of v.rows) drawRow(r);
for (const m of v.movers) drawMover(m.id, m.kind, m.x, m.row, m.length);
Works with
lane-control— the lane rules the moving rows are built on, imported for you; reach for it directly for moving lanes of your own.render-3d— boxes are enough to draw the strip, its traffic and the chicken.frogger— for one screen of lanes with homes to fill.lane-runner-3d,turn-runner-3dandjetpack-runner-2d— for an endless run that moves on by itself.
Good to know
- The chicken, vehicles, logs and trains are spans along a row; a hop is in the air for the hop time and traffic hits it there too.
- Logs and traffic wrap round their row; trains cross once per period.
- Rows are forgotten 40 rows behind the chicken; going back that far is the eagle's.
- The built-in strip is proved crossable by the autopilot on seven, nine and thirteen columns. Rows you author are yours to check: a river of logs too short or too sparse can be impossible to cross.






