Workshop › Scorched Earth-style Artillery › Step 16 of 23
A shell that flies right into the other tank should explode there, even if it hasn't reached the ground yet. The shooting tank itself is skipped, or every shell would hit its own tank as it leaves the barrel.
```js
if (tanks.some((t) => t !== tanks[turn] && Math.hypot(t.x - s.x, t.y - 6 - s.y) < 12)) return 'tank'
```some is true if at least one tank matches: not the shooter, and within 12 pixels of the shell.In fly, check the tanks after the ground.
Skills: Collision detection
← The computer's shot Win or lose →