Now you can run the game, tap on the screen and then tap the play/pause button and the ParticleSystem
class will burst into action.
Quite spectacular for half an hour's work. In fact, you will probably want to reduce the number of particles to less than 100, perhaps make them all white and maybe reduce their size as well. All these things you can easily do by looking at the ParticleSystem
class and its comments.
Note
The screenshot of the particle explosion at the start of the previous chapter was with fewer, smaller and just white particles.
Delete this temporary code from the onTouchEvent
method.
// This is temporary code to emit a particle system mParticleSystem.emitParticles( new PointF(500,500));
Soon, we will spawn our particle system from the physics engine when one of our lasers hits an enemy.