Game Developers usually need to use particle systems to create visual effects. Particle systems can emit a large number of small particles and render them, which is much more efficient than rendering the same number of genie. The particle system can simulate rain, flame, snow, explosion, vapor tail and other visual effects. Particle systems are driven by many attributes. Here there are about 30 "many" types, which not only affect the appearance and behavior of a single particle, but also affect the overall particle effect. Particle effect is a unique visual effect created by all particles working together. A single particle or 10 particles can not achieve the flame effect. Generally, a dozen or even hundreds of particles are required to run in the correct way to produce the flame effect. Was it because of more than 30 attributes? In fact, it is not difficult to create the particle effect. Many people feel that the particle system is difficult when they are not in touch or at the beginning, indeed, it is really difficult for you to create a particle from nothing, but it is very easy if you want to learn to use it and be able to modify others' templates. Next, let's take a look at how to create the particle effect. First, use the built-in class of the system to create CCParticleSnow * snow = [[CCParticleSnow alloc] init]; [snow setTexture: [[CCTextureCache sharedTextureCache] addImage: @ "snow.png"]; snow. position = ccp (300,350); [self addChild: snow]; run: Second: Use the prepared particle effect file (plist) to create CCParticleSystem * snow = [CCParticleSystemQuad participant lewithfile: @ "snow. plist "]; snow. position = ccp (200,350); [self addChild: snow]; run: Third: Create a particle transmitter with code/CCParticleSystemQuad * snow = [[CCParticleSystemQuad alloc] init]; // set the maximum number of particles to be created [snow settotalparticipant: 500]; // set the particle image [snow setTexture: [[CCTextureCache sharedTextureCache] addImage: @ "snow.png"]; // set the duration of the particle to be emitted.-1 indicates that the particle is always fired, and 0 indicates that it is meaningless. Other values indicate the duration [snow setDuration:-1]. // set the particle emission direction, by default, the positive direction of x is right, and the positive direction of y is [snow setGravity: CGPointMake (0,-100)]; // you can set the particle angle and angle change rate [snow setAngle: 0]; [snow setAngleVar: 10]; // sets the Radial Acceleration and acceleration Change Rate [snow setRadialAccel: 0]; [snow setRadialAccelVar: 0]; // set the tangent acceleration and acceleration Change Rate [snow setTangentialAccel: 30]; [snow setTangentialAccelVar: 0]; // set the particle emission position and location change rate [snow setPosition: CGPointMake (200,350)]; [snow setPosVar: CGPointMake (300, 0)]; // set the life cycle and change rate of life cycle [snow setLife: 4]; [snow setLifeVar: 1]; // set the auto-rotation speed starting from the particle and the change rate of the auto-rotation speed. [snow setStartSpin: 30]; [snow setStartSpinVar: 60]; // set the auto-rotation at the end and the auto-rotation change rate [snow setEndSpin: 60]; [snow setEndSpinVar: 60]; // create the color ccColor4F cc; cc. a = 1.0f; cc. B = 255.0f; cc. g = 255.0f; cc. r = 255.0f; ccColor4F cc2; cc2.a = 0; cc2. B = 0; cc2.g = 0; cc2.r = 0; // set the color and color change rate at the beginning. [snow setStartColor: cc]; [snow setStartColorVar: cc2]; // set the color at the end and the color change rate [snow setEndColor: cc]; [snow setEndColorVar: cc2]; // set the particle size at the beginning and the change rate of the particle size [snow setStartSize: 30]; [snow setStartSizeVar: 10]; // set the particle size at the end, and the change rate of the size [snow setEndSize: 10]; [snow setEndSizeVar: 5]; // set the number of particles generated per second [snow setEmissionRate: 100]; [self addChild: snow z: 1]; run: