Workshop › Missile Command-style Defense › Step 30 of 35
The player should see the wave and the ammo left at the top right, a message between waves and one at the end.
```js
ctx.textAlign = 'right'
ctx.fillText('Wave ' + wave + ' Ammo ' + ammo, canvas.width - 10, 22)
ctx.textAlign = 'center'
if (state === 'between') ctx.fillText('Wave ' + wave + ' cleared!', canvas.width / 2, 180)
if (state === 'over') {
ctx.font = 'bold 28px sans-serif'
ctx.fillText('The end', canvas.width / 2, 180)
ctx.font = '16px sans-serif'
ctx.fillText('Click to play again', canvas.width / 2, 210)
}
```canvas.width - 10, the wave and ammo text always ends 10 pixels from the right edge.canvas.width / 2. The end screen has a big title and a small line under it.In draw, under the Score line, write these lines.
Skills: Drawing on a canvas
← Play again Launch from anywhere →