Workshop › Connect Four › Step 28 of 38
When the game is over, a click or a drop key starts a new game. reset already knows how to empty the board.
```js
canvas.addEventListener('pointerdown', (event) => {
if (winner) {
reset()
return
}
event.preventDefault()
if (winner) reset()
else play(hoverCol)
```reset() starts again and return stops there, so the click is not also a move.keydown, a drop key resets when the game is over, and plays otherwise.pointerdown listener write the if (winner) block.keydown, replace play(hoverCol) with the if ... else pair.Skills: Keyboard and mouse input, Game states
← A draw Try a move and take it back →