Workshop › Endless Runner › Step 13 of 19

Faster and faster

What we are doing

The world speeds up a little every frame, up to twice its starting speed. We also add up the distance run, which will become the score.

```js
let distance
  distance = 0

  distance += speed
  speed = Math.min(12, speed + 0.003)
```

What it means

Your turn

  1. Under let speed, write let distance; in reset, under speed = 6, write distance = 0.
  2. In update, under the ground block, write the two lines.

Skills: Game states

All steps

  1. The ground
  2. The runner
  3. Draw again and again
  4. Gravity
  5. Jump
  6. Short hops
  7. Tap to jump
  8. Things that come at you
  9. Cacti keep coming
  10. Wait for the start
  11. Crash
  12. Try again
  13. Faster and faster
  14. Remember the best run
  15. The score counter
  16. Birds
  17. Which keys are down?
  18. Duck
  19. Build it yourself: jump buffering