The final touch we’re going to add are the sparkles. This final layer will add a little more interest to the explosion.
For this effect we’re going to use the sparkle.png image inside the /assets folder. It’s just a white circle with added blur which simulates light emission.
Create a new Particles2D and name it SparkleParticles2D. Drag the sparkle.png image to the Texture property.
Increase the Amount property to 32
, the Explosiveness to 0.2
and the Randomness to 1.0
. This gives us a good amount of particles and lifetime variety to work with in the ParticlesMaterial.
Let’s prevent the position of the particle system from affecting the position of the particles. To do this, toggle the Local Coordinates property to false.
The sparkles should appear in the explosion’s area and move away from the center as the fire bursts.
Create a new ParticlesMaterial as we have done before and change the Emission Shape > Shape to “Sphere”. Set the Radius to 50.0
to match the explosion area.
To make the sparkles move away from the explosion’s center we’re going to apply a constant force on each of them that points outwards from the particle system’s position. Increase the Radial Accel > Accel property to 200
and the Accel Random to 0.3
to allow each particle to accelerate differently.
Finally, increase the Tangential Acceleration to 100
to give a pleasing rotating effect.
To make the particles look like fire, go to the Color > Color Ramp property and use the same Gradient we used in the explosion’s fire burst.
If you’ve saved it in the FileSystem, you can drag it from the FileSystem dock directly to the Color Ramp property.
The sparkles should shine for a brief moment before their fire extinguishes and then fade. For that, we’re going to scale them in and out over their lifetime. But first, to make them look like fire, in the Color > Color Ramp property, use the same Gradient we used in the explosion’s fire burst.
If you’ve saved it in the FileSystem, you can drag it from the FileSystem dock directly to the Color Ramp property. In case you didn’t save it, select the FireBurstParticles2D and find the ParticlesMaterial > Color Ramp property, right-click on it and from the drop-down menu select “Copy”. Going back to the sparkles, right-click on the Color Ramp property slot to paste it. This is one way to reuse resources inside the same scene.
Now that the sparkles look like fire, it’s time to make them shine for a brief moment before their fire extinguishes and fades away.
In the Scale category, decrease the Scale property to 0.1
and increase the Scale Random property to 0.3
to add some variety to the size of the sparkles.
In the Scale Curve property, create a new “CurveTexture”. We’re going to use a mountain-shaped curve to achieve the fade in and out of each sparkle.
All our individual effects are in place and looking good!
Next, we are going to assemble them with an animation player to get our final explosion.