Workshop › Bomberman-style Arena › Step 16 of 42
bombAt finds the bomb on a tile. Nobody can walk into a tile with a bomb, and two bombs never share a tile. You can
still walk off the bomb you just dropped, because walkable only checks the tile you are going to.
```js
const bombAt = (r, c) => bombs.find((b) => b.r === r && b.c === c)
const walkable = (r, c) => grid[r][c] === ' ' && !bombAt(r, c)
const t = tileOf(player)
if (bombAt(t.r, t.c)) return
```find returns the first item for which the function is true, or undefined if none is.!bombAt(r, c) is true when there is no bomb there.dropBomb leaves if the tile already has a bomb.walkable write bombAt, and add && !bombAt(r, c) to walkable.dropBomb, under const t = ..., write the if.Skills: Collision detection
← One bomb at a time The fuse burns down →