[Share] ExplosionParticleDemo – using an improved CCParticleSystem
This is demo is for the latest game special effect competition held by cocoachina forum. The theme this time is – particle explosion effect.
After looking into the CCParticleSystem class in cocos2d framework I found that the support for changing the property of each particle during its life time is quite limited. You can only set the particle property by specifying the startXXX, endXXX, startXXXVar, endXXXVar while initializing. (and it supports linear function type only)

So I made some changes to the CCParticleSystem class.
Here is some features of the demo:
1. A extented CCParticleSystem, CCParticleSystemQuad class
. support scaleX, scaleY
. using delegate to update specified property of each particles during their life time
support delegate::
-(void) updateParticleSize:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleScale:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleSpeed:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleAngle:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleRotation:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleRadialAccel:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleColor:(tCCParticle *)p elapsed:(float)elapse dt:(float)dt;
-(void) updateParticleTangentialAccel:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleRidus:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
-(void) updateParticleDegreesPerSecond:(tCCParticle *)p elapsed:(float)e dt:(float)dt;
. support animated particle (merged from cocos2d-iphone-1.1-beta2b)
. new macro to control the spin and angle property
kCCParticleStartSpinEqualToEndSpin
kCCParticleSpinEqualToAngle
2. CCSlidingMenuLayer
A sliding menu layer I made.
3. CCFrameSprite
A frame sprite I made.
4. ShatteredSprite
Once introduced on my blog – a class to create “break effect” on any CCSprite.
5. CCRemoveAndCleanupAction
Coming together with ShatteredSprite.
6. CCShake
Found on the cocos2d forum – perfect for creating a “Shake Screen” effect.
7. BParticleManager
A manger class for particle optimization.
8. CCMath.h
Some useful macro for using the elementary functions.
9. Various explosion effect classes
Lots of explosion effect unit
10. CCParticleEffectGenerator
Creating cool explosion effects by group up the explosion effect unit in different ways.
Using the particle delegate allows you more control of the particle properties during its life time. You can use piecewise function && quadratic function, power function, trigonometric function … to bring more cool effect to the particle system.
☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
If you feel all the stuffs in this site helped you a lot and you can get a game I made 🙂
☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
Awesome effect!
哇塞 楼主 太牛X了。。。嘿嘿 作为一名cocos2dx初学者敬佩不已
没有c++版本的么?
这个没有c++的版本,里面的那个shattersprite我倒是移植了下~
非常好的爆炸效果 谢谢LZ
呵呵,不客气:)
我下了C++版本的ShatterSprite,但是没有碎的效果,能指导下吗
[…] CCParticleSystem: extension of cocos2d particles – LINK […]
我好像不能下载,请问您在哪里下载?谢谢
非常好的效果,
俺是cocos2d的新手,请教下
貌似我下的代码是基于 cocos2d v2.1-beta2 的, 里面的CCParticleSystem的startWidthScale 等等, 在v2.1 里木有, 这个需要怎么移植到 v2.1上?
非常感谢
这个肯定没有的,因为是我自己增加的方法,如果你想用的可以把这些方法复制到你的cocos2d-x库里的对应文件中~