Workshop › Puzzle Bobble-style Bubble Shooter › Step 29 of 31
When a game ends with a new record, it is saved in localStorage and shown on the right of the top bar.
```js
let best = Number(localStorage.getItem('bubbles-best')) || 0
if (state !== 'playing' && score > best) {
best = score
localStorage.setItem('bubbles-best', best)
}
ctx.textAlign = 'right'
ctx.fillText('Best ' + best, canvas.width - 10, 21)
```textAlign = 'right' makes the text end 10 pixels from the right edge.let state, write best.attach, save the record.draw, under the Score line, write the two Best lines.Skills: Game states