Workshop › Bomberman-style Arena › Step 23 of 42
In its last 45 frames a bomb blinks red, switching every 5 frames: "I am about to go off!"
```js
// Bombs blink faster as the fuse runs out.
for (const b of bombs) drawCircle({ x: b.c, y: b.r }, b.fuse < 45 && b.fuse % 10 < 5 ? '#dc2626' : '#020617', 12)
```b.fuse % 10 goes 9, 8, ... 0 and round again as the fuse runs down, so < 5 switches every 5 frames.b.fuse < 45 too is the bomb red; otherwise it stays black.In draw, write the comment above the bombs line and change its color as shown.
Skills: Drawing on a canvas
← Chain reactions Flames hurt →