Workshop › Simon Says Colors › Step 22 of 27
When the game is over, a click, or Space, starts a new game with reset.
```js
canvas.addEventListener('pointerdown', (event) => {
if (state === 'over') {
reset()
return
}
if (event.key === ' ' && state === 'over') {
event.preventDefault()
reset()
}
```return stops it from also pressing a pad.&& means "and". preventDefault() stops Space from scrolling the page.pointerdown listener, write the if (state === 'over') block.keydown listener, write the Space block.Skills: Keyboard and mouse input, Game states
← A function for a new game Light up when pressed →