Workshop › Mario-style Platformer › Step 24 of 37
collected counts the coins. The counter is drawn after ctx.restore(), in screen coordinates, so it stays in the
corner while the world scrolls.
```js
let collected
collected = 0
collected += 1
ctx.fillStyle = 'white'
ctx.font = 'bold 18px sans-serif'
ctx.textAlign = 'left'
ctx.fillText('Coins: ' + collected, 12, 26)
```collected starts at 0 in loadLevel and goes up by one for each coin taken.restore, so (12, 26) is always the screen's top-left corner.let camera write let collected; in loadLevel, under camera = 0, write collected = 0.coin.taken = true, write collected += 1.draw, under ctx.restore(), leave an empty line and write the four text lines.Skills: Game states, Drawing on a canvas