Workshop › Bomberman-style Arena › Step 25 of 42
After losing a life the player is safe for 120 frames (two seconds), and blinks to show it. Only when safe is back
at 0 can flames hurt again.
```js
let safe // frames of invincibility after losing a life
safe = 0
safe = 120
if (safe > 0) safe -= 1
else if (inFlames(player)) hurt()
if (safe % 10 < 5) drawCircle(player, '#f8fafc', 12)
```hurt sets safe to 120; update counts it down, and only checks the flames when it is 0.safe % 10 < 5, which switches every 5 frames. At 0 it is always drawn.let lives write let safe; in reset, under lives = 3, write safe = 0.hurt, write safe = 120.update, replace the flame line with the two safe lines.draw, put if (safe % 10 < 5) in front of the player's drawCircle.Skills: Game states