What the best way to create 2D blast radius (or smart bomb)?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GodotBadger

I’m thinking of adding a smart bomb (like in “Defender”, not a clever bomb…) to my Asteroids game.
What’s the best way of going about this? I don’t want it to be instantaneous, i.e. instantly kill everything in a given radius, but to gradually spread from a point to radius in a second or so, timed with a particle explosion.

I was thinking of using a Colission2D shape and expanding its radius timed with the particle explosion.

Is this a sensible way to do it, or is there something I can do with the particle explosion alone or any other suggestions?

:bust_in_silhouette: Reply From: Sween123

It’s about rendering.
You can have exoplosion art in your game, a spritesheet or something.
When the bomb explodes, start rendering. You can have a variable, something like rending_required, if it’s true, call start_rendering(). You should create methods like start or end rendering. After you start, you can try to use AnimationPlayer, AnimatedSprite, or something else to do this animation with the spritesheet you have. To make sure that the explosion spreading size is right, you can use the property "scale" according to what radius is given.
If you want to remove the bomb after it explodes: There are two ways.

  1. Only remove it after rendering finished.
  2. Remove it immediately when exploding function is called and create a new animation scene for the rendering of the explosion effect.
    Same for killing characters. Definitely you don’t want to instantly kill everything without playing their death animations. It’s similar to the bomb scene. When the bomb explodes, the bomb “dies” and the animation is “death”. So when character dies, using the same way how you remove the bomb to not instantly get killed without rendering death animations.