Workshop › Typing Rain › Step 21 of 33
When the game is over, a dark panel shows Game over and how to play again.
```js
if (state === 'over') {
ctx.fillStyle = 'rgba(2, 6, 23, 0.85)'
ctx.fillRect(40, 105, canvas.width - 80, 120)
ctx.fillStyle = 'white'
ctx.textAlign = 'center'
ctx.font = 'bold 26px sans-serif'
ctx.fillText('Game over', canvas.width / 2, 140)
ctx.font = '18px sans-serif'
ctx.fillText('Press Enter to play again', canvas.width / 2, 175)
}
```state === 'over'; it is drawn after the words, so it covers them.rgba(2, 6, 23, 0.85) is the sky's color at 85% opacity: the frozen words show through a little.In draw, under the hearts line, leave an empty line and write the if block.
Skills: Drawing on a canvas
← Freeze the game Play again →