You can also add particle effects to the game with a few lines of code.
To create the particle effect, we need to import the image file that will be used by the effect first of all. In this case, it is the
fire.png file. Import it into the project.
To add the particle effect to the project, we will add the following to the bottom of the
init function right after the
CCParticleFire* fire = [[CCParticleFire alloc]initWithTotalParticles:20]; fire.position = CGPointMake(winSize.width/2, winSize.height/2); [self addChild:fire];
Here, we created a fire effect, so we used
CCParticleFire to create the particle system. While initializing the particle system, we need to pass in the number ...