Workshop › Pac-Man-style Maze Chase › Step 17 of 42
When both sets are empty the maze is cleared: the level goes up, the pellets come back and everyone starts from the beginning.
```js
if (pellets.size === 0 && powers.size === 0) {
level += 1
fillPellets()
placeActors()
}
```size is how many keys a set holds. Both empty means nothing is left to eat.At the end of arrive, write the if block.
Skills: Game states
← Show the score A red ghost →