Workshop › Pong › Step 20 of 26
When the game is over, the ball disappears and the winner is announced in the middle.
```js
if (state === 'playing') ctx.fillRect(ball.x, ball.y, BALL, BALL)
if (state === 'over') {
const winner = left.score >= WIN_SCORE ? 'Left' : 'Right'
ctx.font = 'bold 32px sans-serif'
ctx.fillText(winner + ' player wins!', canvas.width / 2, canvas.height / 2)
ctx.font = '16px sans-serif'
ctx.fillText('Press Space to play again', canvas.width / 2, canvas.height / 2 + 32)
}
```WIN_SCORE; the text is centered (the alignment was set for the scores).if (state === 'playing') in front of the ball's fillRect.draw, under the scores, write the if (state === 'over') block.Skills: Drawing on a canvas