For many games, there will be events where we want to display an explosion in the scene, such as when the player's character dies or when they collide with an object that deals damage. We can quite easily create a visual explosion effect using an appropriate 2D image and a particle system that fires one with a burst of many fast-moving, short-lived particles, in all directions. That's what we'll create in this recipe:
Figure 14.29 – The explosion effect we'll create