---
title: 'The runner''s speed rule, rebuilt · Reverse Engineer Projects speed lab'
url: https://reverseengineerprojects.com/examples/speed-lab/
---

[Home](https://reverseengineerprojects.com/) / [Showcases](https://reverseengineerprojects.com/showcase/) / 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

          Play
          Jump
          Speed 6.0
           Use the recovered rule
          Your speed

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

## The script's rule

    index.js · config and update[Source, lines 565-571 ↗](https://raw.githubusercontent.com/wayou/t-rex-runner/5455bfa408ec6b707c7300ff194b7390733a766d/index.js)

```
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

- [Set up REP](https://reverseengineerprojects.com/get-started/) with your coding agent.

- Open Chrome with a debugging port ([how](https://reverseengineerprojects.com/guides/browser/#prepare)) and load a copy of the runner game.

- 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.”

  On this page[Play](#play)[The rule](#rule)[Check it](#check)[Try it yourself](#yourself)
