Simulating an explosion
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 15.24: The explosion effect we’ll create
Getting ready
For this recipe, we need an image of an explosion, so we’ll use the firecloud.png
image that’s been published on the PNG-EGG website. Thanks to GAMEKILLER48 for sharing this asset for game developers to use.
We’ve prepared the file you need in the 15_05
folder. Alternatively, you can download the image directly from the PNG-EGG website: https://www.pngegg.com/en/png-ffmwo.
How to do it...
To create a Particle...