
Learning Java by Building Android Games
By :

A particle system is a system that controls particles. In our case, ParticleSystem
is a class that will spawn instances (lots of instances) of the Particle
class that will create a simple explosion effect. Here is an image of the particles controlled by the particle system as it will appear by the end of this chapter:
Figure 19.3 – Particle system explosion
Important note
The particle system in the finished game is plain white with smaller particles. By the end of this chapter, it will be explained how to achieve both types of particle and you can then choose. The smaller plain white particle suits the game better (in my opinion), but the big multi-colored particles show up better in the pages of a book.
Just for clarification, each of the colored squares is an instance of the Particle
class, and all the Particle
instances are controlled and held by the ParticleSystem
class.
We will start by coding the...