Browser / Interactive case study / 16 min read
Dino: why does the game keep getting faster?
Use REA to investigate a Chromium-derived dinosaur game. Recover its acceleration rule, add a speed control, and test a floating-point edge case.
On this page
01. Try it before taking it apart
Press Play and jump over the obstacle. Drag the speed slider from 3 to 12: the obstacle moves faster immediately. Turn automatic acceleration back on and watch the number slowly climb from 6.000.
Press Play, then Jump. Changing the slider selects a fixed speed.
New teaching game. Only the acceleration rule follows the documented investigation.
A playable experiment and a speed function checked at five update counts.
Before the investigationThe lab runs here. For the investigation: REA connected to your agent, Chrome, and the public HTTP version of the game. Start with our installation guide if REA is not connected. Set up REA →
02. Connect to the version you can inspect
Open wayou’s public t-rex-runner in a separate Chrome debugging profile. The command below is for macOS; on Windows or Linux, use your Chrome executable with the same flags. Keep this browser and terminal open while investigating.
This tutorial targets an HTTP page, not chrome://dino. If the page has changed, save the script you actually read and record its digest before comparing it with the historical results below.
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port=9222 \
--user-data-dir="$(mktemp -d /tmp/rea-dino.XXXXXX)" \
https://wayou.github.io/t-rex-runner/Use REA to list_browser_targets at http://127.0.0.1:9222. Select the t-rex-runner page by its URL, then inspect_web_page with include_script_sources enabled. Read the loaded index.js. Find the initial speed, acceleration increment, update condition and speed threshold. Cite source locations. Do not rebuild the game yet.03. Ask what one “update” actually means
A setting named ACCELERATION is a clue, not the complete explanation. Follow where the setting is consumed. Does it run on every render, only during play, or only when no collision occurs? Ask the agent to include the surrounding condition so the answer survives more than the happy path.
The documented version starts at 6 and adds 0.001 on an eligible update if the current speed is below 13. That is not “0.001 per second.” Our teaching game uses 60 fixed logic updates per second; it draws independently of your display’s refresh rate.
- Record the value before and after a single update.
- Find the collision or playing-state condition around the increment.
- Check whether the threshold is tested before or after addition.
- Keep frame timing separate from the recovered arithmetic.
04. Add a speed dial without losing the rule
Build the smallest game that makes the rule visible. Use a simple character, one obstacle, a jump button and a speed readout. The slider should switch to fixed speed; enabling automatic mode should return to the documented starting value.
Do not silently replace the condition with a clamp to 13. That seems like a harmless cleanup, but it changes the result at the boundary. Keep the first implementation literal, then make intentional changes in a separate mode.
Create an independent browser mini-game with Play/Pause, Jump and Restart. Reproduce only the documented speed update rule. Add a fixed-speed slider from 2 to 18 and an automatic mode starting at 6. Use a fixed logic timestep, pause offscreen, and allow keyboard and touch controls. Label new graphics, collision and jump behavior as teaching code. Test the imported speed function, not a second copy of it.05. Investigate the extra 0.001
Run the speed function repeatedly without collisions. Compare the checkpoints below, keeping the unrounded value in the saved result. The surprising final value is the useful part of this exercise: a comparison happens before addition, and repeated floating-point increments need not land exactly on a decimal threshold.
If your result is 13.000 at 10,000 updates, check for a clamp or decimal rounding inside the loop. If it varies with screen refresh rate, check whether the simulation advances once per rendered frame.
Replay the actual acceleration function for 0, 1000, 4000, 7000 and 10000 updates from speed 6. Return full precision and three-decimal displays. Compare with the source report, explain mismatches, and identify whether you executed our replacement or the original game. Do not treat a source read as an original-game runtime test.06. Compare known results
Use these as explicit checkpoints. Matching them supports this small rule; it does not establish whole-application compatibility.
| Updates | Expected display | Question answered |
|---|---|---|
| 0 | 6.000 | Starting value |
| 1,000 | 7.000 | Increment per update |
| 4,000 | 10.000 | Accumulation |
| 7,000 | 13.000 | Rounding can hide the edge |
| 10,000 | 13.001 | Compare before adding |
Save both files in the same folder. Run the checks with Node.js; no package installation is needed.
node check-case-labs.mjs07. What was actually verified?
The REA report contains controlled runs of the original HTTP game. This site checks its own speed module against those recorded checkpoints; we did not rerun the original game’s inspection. The graphics, jump, collision and obstacle spacing above are new teaching code. Only the acceleration rule is being reconstructed.
Read this site’s recorded numeric test results →
Sources: REA’s calculator and dinosaur evidence · Pinned game update branch. Tutorial, illustrations and browser experiments independently authored.
New to the tool? What is REA? · How we check our guides