Workshop › Bomberman-style Arena › Step 33 of 42
When the last enemy is gone, you win: state becomes 'won', and the panel says All enemies gone!.
```js
if (state === 'playing' && enemies.length === 0) {
state = 'won'
}
ctx.fillText(state === 'won' ? 'All enemies gone!' : 'Game over', canvas.width / 2, 190)
```update, after the flames have done their work. state === 'playing' makes sure a player
who lost the last life in the same frame does not win.? :.update, write the if block.'Game over' to the ? : shown.Skills: Game states
← Fight and touch Hidden power-ups →