Workshop › Scorched Earth-style Artillery › Step 11 of 23
An explosion digs a round hole. For each column within the blast, the bottom of a circle of radius 30 is found; if it is lower than the ground there, the ground drops to it. Holes never go through the bottom of the screen.
```js
// Blow a round hole in the ground and hurt the tanks nearby.
for (let cx = Math.floor(x - BLAST); cx <= x + BLAST; cx++) {
if (cx < 0 || cx >= W) continue
const bottom = y + Math.sqrt(BLAST * BLAST - (cx - x) ** 2)
if (bottom > ground[cx]) ground[cx] = Math.min(H - 2, bottom)
}
```d from the middle, its bottom is √(r² − d²) below the middle (Pythagoras).continue skips columns off the canvas.explode, write the comment.explode, dig the hole.Skills: Velocity and gravity, Arrays and objects