This code will run a plist particle system in Cocos2d-x
CCParticleSystem* emitter = CCParticleSystemQuad::create("blood.plist");
this->addChild( emitter, 5 );
emitter->setPosition( deadMonster->getSprite()->getPosition());
CCCallFunc* moveCallback = CCCallFunc::create(emitter,
callfunc_selector(CCParticleSystem::removeFromParent));
CCDelayTime* delayAction = CCDelayTime::create(0.3f);
emitter->runAction(CCSequence::create(delayAction, moveCallback, NULL));
No comments:
Post a Comment