void GameEntityView::doLifedrain( ICastEntity* to ) { CCParticleFire* life = CCParticleFire::createWithTotalParticles(25); CCPoint point = m_healthBar->boundingBox().origin; life->setStartColor( ccc4f(0,1.0f,0,1.0f) ); life->setEndColor( ccc4f(0,1.0f,0,1.0f) ); life->setPosition(ccp(0,0)); //TODO: use physics interface to get position of 'to' entity and direct stream life->setGravity( CCPointMake( -30, 0 ) ); life->setStartSize(25); life->setPosVar( CCPointMake( 10,10 )); m_healthBar->addChild(life); CCSequence* seq = CCSequence::create( CCDelayTime::create(0.5f), CCCallFunc::create(life, callfunc_selector(CCParticleFire::stopSystem)), CCDelayTime::create(2.5f), CCRemoveSelf::create(true), NULL ); life->runAction(seq); }
void GameEntityView::doHeal() { CCParticleFire* heal = CCParticleFire::createWithTotalParticles(25); CCPoint point = CCPointMake( m_healthBar->getContentSize().width/2, 0 ); heal->setStartColor( ccc4f(1,1,1,1.0f) ); heal->setEndColor( ccc4f(1,1,1,1.0f) ); heal->setSpeed(10); heal->setStartSize(15); CCPoint posVar = heal->getPosVar(); posVar.y /= 2; heal->setPosVar( posVar ); heal->setPosition( point ); m_healthBar->addChild(heal); CCSequence* seq = CCSequence::create( CCDelayTime::create(0.5f), CCCallFunc::create(heal, callfunc_selector(CCParticleFire::stopSystem)), CCDelayTime::create(1.5f), CCRemoveSelf::create(true), NULL ); heal->runAction(seq); }
void GameEntityView::doBurn() { //CCLog("particle system burn"); CCParticleFire* fire = CCParticleFire::createWithTotalParticles(150); CCPoint point = CCPointMake( m_healthBar->getContentSize().width/2, 0 ); //fire->stopSystem(); fire->setSpeed(20); fire->setStartSize(25); CCPoint posVar = fire->getPosVar(); posVar.y /= 2; fire->setPosVar( posVar ); fire->setPosition( point ); m_healthBar->addChild(fire); CCSequence* seq = CCSequence::create( CCDelayTime::create(0.5f), CCCallFunc::create(fire, callfunc_selector(CCParticleFire::stopSystem)), CCDelayTime::create(2.5f), CCRemoveSelf::create(true), NULL ); fire->runAction(seq); }