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: ...

Get Learning Cocos2d-x Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.