Workshop › OutRun-style Racer › Step 43 of 44
After the finish, Space (or a tap on a phone) starts a new race. reset already knows how to put everything back, so we
only call it.
```js
if (event.key === ' ' && state === 'finished') reset()
canvas.addEventListener('pointerdown', (event) => {
if (state === 'finished') {
reset()
return
}
```' ' is the name of the Space key. Space only restarts a finished race.returns, so it does not also press the gas.keydown listener, under the preventDefault line, write the Space line.pointerdown function, write the if block.Skills: Keyboard and mouse input, Game states
← Finished! Build it yourself: beat the clock →