Workshop › Conway's Game of Life › Step 18 of 32
We want to look at a pattern before it runs. A variable playing says whether the world is running; it starts as
false, and update only steps while it is true.
```js
let playing
playing = false
if (playing && frames % SPEED === 0) step()
```playing is true or false; reset sets it to false, so a new world waits.playing && ... in update: step only when playing and it is time.let generation write let playing.reset, under randomize(), write playing = false.update, add playing && at the start of the condition.Skills: Game states
← Let it live One place for the buttons →