转载自:http://blog.sina.com.cn/s/blog_6e29f5680100vqir.html
-(void) playEffectSnow { //使用自带下雪粒子 CCParticleSnow *particle = [CCParticleSnow node]; //自定义雪花图片 particle.texture = [[CCTextureCache sharedTextureCache] addImage:@"snow.png"]; //粒子总数 particle.totalParticles = 400; //下雪时间 秒 particle.duration = 3; //雪花开始大小 particle.startSize = 40; //雪花大小浮动 particle.startSizeVar=20; //雪花结束大小 //particle.endSize = 50; //particle.endSizeVar = 30; //初始速度 particle.speed = 20; particle.speedVar = 15; //下降速度 y负数表示下落 x负数表示向西吹 particle.gravity = ccp(-20, -70); //每个雪花生命时间 particle.life = 4.0f; particle.lifeVar = 2.0f; //particle.position = ccp(240, 320); //释放雪花速度 particle.emissionRate = particle.totalParticles/particle.life; //动画完成后自动从上层layer中移除粒子 particle.autoRemoveOnFinish = YES; //释放粒子位置 particle.position = (CGPoint) { [[CCDirector sharedDirector] winSize].width / 2, [[CCDirector sharedDirector] winSize].height + 10 }; particle.posVar = ccp( [[CCDirector sharedDirector] winSize].width / 2+50, 0 ); //添加到layer中 [self addChild:particle z:1000]; }