Workshop › OutRun-style Racer › Step 40 of 44
The game needs to know what it is doing: 'racing' or 'finished'. We keep that in state. When the race is not on,
update does nothing and the car stands still.
```js
let state // 'racing' or 'finished'
state = 'racing'
function update() {
if (state !== 'racing') return
```reset sets state to 'racing'.!== means "is not equal to". return leaves the function at once, so nothing below it runs.let lapTime write let state; in reset, under lapTime = 0, write state = 'racing'.update, write the return line.Skills: Game states
← Show the best lap The finish line →