To remove a particle system, just remove it from its parent node. It's the best way.
If your particle system doesn't have a infinite duration, the best way is use setAutoRemoveOnFinish
. It will automatically remove the system from parent node when particle system ends.
If your particle system have a infinite duration, then use removeChild
with cleanUp:YES
(you dont need to set stopSystem before
). This way the system is removed forced.
Or you can use stopSystem
with setAutoRemoveOnFinish:YES
, and the system will be removed after the last particle ends. This way the system is removed smoothly.
Other tips:
- Use
CCParticleSystemQuad
instead ofCCParticleSystem
. - Is recommended that you create your particle system using an
autorelease
constructor, like[CCParticleSystemQuad particleWithFile:]
or[CCParticleSystemQuad particleWithTotalParticles:]
. - And, of course, use
release
if you have a property retaining it.