Time for action – adding the feathers explosion
We are going to add an explosion of feathers when the arrow hits the bird. We will create about 100 feather particles at the bird's center point and then explode them in different directions gradually fading away.
To do this, we are going to add a few methods into the Bird.m
file and call it when an arrow hits the bird. After that, we will just add our particle image to the project and we are done. Refer to the following steps:
We will start by adding the method that creates a particle system. Go ahead and open the
Bird.m
file, and add the following method right above theremoveBird:
method:-(void)explodeFeathers { //1 int totalNumberOfFeathers = 100; //2 CCParticleSystem *explosion = [CCParticleSystem particleWithTotalParticles:totalNumberOfFeathers]; //3 explosion.position = self.position; //4 explosion.emitterMode = CCParticleSystemModeGravity; //5 explosion.gravity...