Play and change the speed
Press Play, then jump over the cactus. Move the speed slider to try a slower or faster game; it switches to a fixed speed. Select the recovered rule to start at 6 and gradually accelerate again.
Play the reconstruction
Original rule: start at 6, then increase toward 13.
Read the script REA returned
We inspected
wayou’s Chromium-derived browser edition
with REA. It returned the loaded index.js, including
this branch in the game’s update function:
if (this.currentSpeed < this.config.MAX_SPEED) {
this.currentSpeed += this.config.ACCELERATION;
}
The settings are SPEED: 6,
ACCELERATION: 0.001 and MAX_SPEED: 13.
The game runs this branch on an update without a collision.
Use the same rule in the new game
function advanceSpeed(speed) {
return speed < 13 ? speed + 0.001 : speed;
}
The mini-game uses this function for automatic acceleration. Moving the slider supplies a fixed speed instead. Drawing, jump physics and rectangle collision checks are new code for this teaching game; its simulation advances at 60 updates per second.
Check the reconstruction
We called the original game’s update function with obstacles and automatic scheduling disabled. Compare those recorded speeds with a replay of the recovered rule.
| Updates | Original game | Reconstructed rule |
|---|---|---|
| 0 | 6.000 | 6.000 |
| 1,000 | 7.000 | 7.000 |
| 4,000 | 10.000 | 10.000 |
| 10,000 | 13.001 | 13.001 |
Values rounded to three decimals. The branch checks before adding, so the final increment can take speed just above 13.
Try the analysis yourself
- Set up REA with your coding agent.
-
Follow the
browser connection steps, using
https://wayou.github.io/t-rex-runner/as the page URL. - Give your agent the page URL and local debugging endpoint, then copy this prompt.
Use REA to inspect this dinosaur game. Why does it get faster? Show the speed rule, then build a small version with an adjustable speed.
Ask a follow-up: “Where is jump height calculated? Add a jump-height control to the new version.”
Source: inspected speed code, Chromium Authors. Copyright and BSD license. REA 4.1.0 inspected the running HTTP edition in Chrome 150.