O'Reilly logo

Learning Cocos2d-x Game Development by Siddharth Shekar

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

Creating your own particle system

In this section, we will create a small mock particle system that will create an image of the enemy and gun and make it look as if she is spinning and falling down once hit by the rocket. As we have already deleted the enemy, we just have to spawn the new enemy and gun sprites and remove it from the display list after a while. For this, we will create a class that will take an image, spin it, and make it fall down.

Create a new class called ParticleSpin and create the respective .h and .cpp files. Next, add the following to the ParticleSpin.h file:

#ifndef __wp8Game__ParticleSpin__ #define __wp8Game__ParticleSpin__ class ProjectileObject; #include <iostream> #include "cocos2d.h" using namespace cocos2d; class ParticleSpin: ...

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