Workshop › Doodle Jump-style Climber › Step 18 of 24
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)
```START_Y - player.y - player.h is how far the feet are above the first platform.Math.max(score, ...) keeps the bigger of the old score and the new height, so it never goes down.highest, write let score; in reset, set it to 0.update, under the camera line, work out the score.draw, before the game over block, write the score text.Skills: Game states
← Tap to play again Best score →