Working with particle systems
Particle systems can provide our games with very attractive effects for many different events in our games, such as explosions, sparks, gore, rain, and much more. In this chapter, we're going to cover AndEngine's ParticleSystem
classes which will be used to create customized particle effects that will suit our every need.
Getting ready…
This recipe requires basic knowledge of the Sprite
object in AndEngine. Please read through the entire recipes, Working with different types of textures in Chapter 1, AndEngine Game Structure, as well as Understanding AndEngine entities given in this chapter. Next, create a new empty AndEngine project with a BaseGameActivity
class and import the code from the WorkingWithParticles
class in the code bundle.
How to do it…
In order to begin creating particle effects in AndEngine, we require a bare minimum of three objects. These objects include an ITextureRegion
object which will represent the individual particles spawned, a ParticleSystem...