Workshop › Snake › Step 25 of 28
After game over, Space (or Enter) calls reset(). A line under "Game Over" tells the player how.
```js
if (gameOver && (event.key === ' ' || event.key === 'Enter')) {
reset()
return
}
ctx.font = '16px sans-serif'
ctx.fillText('Press Space to play again', canvas.width / 2, canvas.height / 2 + 32)
```' ') or Enter: start a new game and stop there.if (gameOver) block of draw, under the Game Over line, add the two lines.Skills: Keyboard and mouse input
← One function that starts a game Remember the best score →