Home / Showcases / Speed lab

Rebuild the runner's speed rule.

Chrome's offline runner speeds up as you survive. The rule is three numbers in its script. Here it is in a small game of our own, with a slider for your own speed.

Play and change the speed

Speed 6.0
Space, the Jump button or a tap jumps. Untick the rule to drive the speed yourself.

The script's rule

index.js · config and updateSource, lines 565-571 ↗
ACCELERATION: 0.001,
MAX_SPEED: 13,
SPEED: 6,
…
if (this.currentSpeed < this.config.MAX_SPEED) {
  this.currentSpeed += this.config.ACCELERATION;
}

The inspected copy is a public, Chromium-derived edition of the game (BSD licence). Our game keeps only the rule; its drawing, jumping and obstacles are our own small code.

Check the rule

The same rule, counted update by update in your browser right now:

Top speed arrives after 7,000 updates. From there it holds at 13.

Try the analysis yourself

  1. Set up REP with your coding agent.
  2. Open Chrome with a debugging port (how) and load a copy of the runner game.
  3. Ask your agent: “Use REP to read this runner game's script. Why does it speed up? Show me the rule, then build a small version with a speed slider.”