O'Reilly logo

Learning iPhone Game Development with Cocos2D 3.0 by Kirill Muzykov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. 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 the removeBird: method:
    -(void)explodeFeathers { //1 int totalNumberOfFeathers = 100; //2 CCParticleSystem *explosion = [CCParticleSystem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required