Workshop › Missile Command-style Defense › Step 21 of 35
Only your explosions (and the chains they start) should destroy missiles. Each blast gets an own flag: true for
interceptors and chains, false for impacts on the ground.
```js
let blasts // explosions: { x, y, age, own }: own ones destroy missiles, impacts on the ground do not
blasts.push({ x: s.x, y: s.y, age: 0, own: true })
if (blasts.some((b) => b.own && Math.hypot(m.x - b.x, m.y - b.y) <= radius(b))) {
m.done = true
blasts.push({ x: m.x, y: m.y, age: 0, own: true })
blasts.push({ x: m.x, y: m.y, age: 0, own: false })
```own: true, ground impacts own: false.b.own && ...: only own blasts are checked; && stops at the first false part.Change the places shown: the let blasts comment, the interceptor's blast, the some check and the two missile
blasts.
Skills: Collision detection, Game states
← Chain reactions Points for every missile →