Workshop › Doodle Jump-style Climber › Step 18 of 24

Score is height

What we are doing

The score is the greatest height reached, in tens of pixels above the first platform. Falling back does not lower it.

```js
let score
  score = 0

  score = Math.max(score, Math.floor((START_Y - player.y - player.h) / 10))

  ctx.fillStyle = '#0f172a'
  ctx.font = 'bold 18px sans-serif'
  ctx.textAlign = 'left'
  ctx.fillText('Score: ' + score, 10, 26)
```

What it means

Your turn

  1. Under highest, write let score; in reset, set it to 0.
  2. In update, under the camera line, work out the score.
  3. In draw, before the game over block, write the score text.

Skills: Game states

All steps

  1. The jumper
  2. Draw again and again
  3. Gravity
  4. Bounce
  5. Steer left and right
  6. Through the sides
  7. Half here, half there
  8. Touch steering
  9. Platforms
  10. Land on platforms
  11. A camera that follows
  12. Lines on the wall
  13. How hard should it be?
  14. Endless platforms
  15. Miss and fall
  16. Play again
  17. Tap to play again
  18. Score is height
  19. Best score
  20. Kinds of platform
  21. Moving platforms
  22. Traps
  23. It breaks!
  24. Build it yourself: springs