Workshop › Bomberman-style Arena › Step 32 of 42
Enemies die in flames, and touching one costs a life. "Touching" is measured between the real positions, not the tiles: closer than 0.6 of a tile.
```js
enemies = enemies.filter((e) => !inFlames(e))
else if (inFlames(player) || enemies.some((e) => Math.hypot(e.x - player.x, e.y - player.y) < 0.6)) hurt()
```filter keeps the enemies that are not in flames.Math.hypot(dx, dy) is the straight distance between two points (Pythagoras).update, under the flames filter, write the enemies filter.else if (inFlames(player)) condition with || enemies.some(...).Skills: Collision detection
← No turning back All enemies gone →