void BlackHoleEffectTest::attenuationComplete(CCObject* obj) { //这里可以将黑洞的显示效果慢慢缩小。 BlackHoleEffect* blackHole = (BlackHoleEffect*)obj; CCParticleSystemQuad* blackHoleParticle = (CCParticleSystemQuad*)blackHole->getUserObject(); CCScaleTo* st = CCScaleTo::create(2, 0); blackHoleParticle->runAction(st); }
void HSBalloonSprite::PlayDestroyBalloonEffect() { this->setVisible(false); CCParticleSystemQuad* pParticle = CCParticleSystemQuad::create("Particle/DestroyBalloon.plist"); pParticle->setPosition(m_destroyPos); HS_GET_BattleLayer()->addChild(pParticle,1100); CCDelayTime* pDelayTime = CCDelayTime::create(1.f); CCCallFuncND* pCall_01 = CCCallFuncND::create(this,callfuncND_selector(HSBalloonSprite::Call_PlayDestroyBalloonEffect),NULL); pParticle->runAction(CCSequence::create(pDelayTime,pCall_01,NULL)); }
void MainFooterLayer::showLiziXiaoguo(CCNode* pParent, int iTag) { //极限守城20级开启,所以效果20级才显示 //竞技8级开启,所以效果8级才显示 int iMinLevel = 8; if (iTag == TAG_Jixianshoucheng_lizi_Ani) { iMinLevel = 20; } if (!pParent || MyselfManager::getManager()->getMyZhuJueData()->getCurrentProperty().level < iMinLevel) { return; } CCNode* pNode = pParent->getChildByTag(iTag); if (pNode) { return; } CCParticleSystemQuad* par = CCParticleSystemQuad::create("jingji_xiaoguo.plist"); pParent->addChild(par, 2, iTag); //par->setScale(0.5f); //par->setSpeed(10); par->setPosition(ccp(0, 0)); CCPointArray *array = CCPointArray::create(20); array->addControlPoint(ccp(0, 0)); array->addControlPoint(ccp(pParent->getContentSize().width, 0)); array->addControlPoint(ccp(pParent->getContentSize().width, pParent->getContentSize().height)); array->addControlPoint(ccp(0, pParent->getContentSize().height)); float dt = 0.5f; CCMoveTo* action1 = CCMoveTo::create(dt, array->getControlPointAtIndex(1)); CCMoveTo* action2 = CCMoveTo::create(dt, array->getControlPointAtIndex(2)); CCMoveTo* action3 = CCMoveTo::create(dt, array->getControlPointAtIndex(3)); CCMoveTo* action4 = CCMoveTo::create(dt, array->getControlPointAtIndex(0)); CCSequence* quece = CCSequence::create(action1, action2, action3, action4, NULL); par->runAction( CCRepeatForever::create( //FXCircleBy::create(1.0f, ccp(pJingjiItem->getContentSize().width/2, pJingjiItem->getContentSize().height/2 + 5), 24, 360) quece ) ); }
//----------------------------------------------- // // void CPet::upMainData( ccTime dt ) { if( CPET_STATE_DISTANCE_ATTACK == m_iState ) { //int index = GetCurentIndex(); CBaseDataPet* pDataPet = g_pClientLoader->GetBaseDataPetFromId(m_PetData.petid); CBaseDataSkill* pDataSkill = g_pClientLoader->GetBaseDataSkillFromId(pDataPet->skillfield[m_PetData.skilllevel.skillsLevel[0]-1]); if( pDataSkill->attack_frame <= GetCurentIndex()) { CCMoveTo *to1 = CCMoveTo::actionWithDuration( 1.0f, m_pLockTarget->getPosition() ); SAttackType *pAttackType = new SAttackType(); pAttackType->Type = 1; CCFiniteTimeAction *pCallBack = CCCallFuncND::actionWithTarget( this, callfuncND_selector( CPet::AttackBeginCallBack ), pAttackType ); std::string effectpath = GetGameParticlePath(); std::string filename = effectpath + pDataSkill->plist.c_str(); CCParticleSystemQuad *pEmitter = CCParticleSystemQuad::particleWithFile( filename.c_str() ); //panda if( m_PetData.petid >= 41 && m_PetData.petid <= 50 ) { pEmitter->setPositionType( kCCPositionTypeGrouped ); } if( FIGHT_LEFT_PLAYER_POS == m_iSitId ) { pEmitter->setPosition( ccp( getPosition().x + 32, getPosition().y ) ); } else { pEmitter->setPosition( ccp( getPosition().x - 16, getPosition().y ) ); } if( CCUserDefault::sharedUserDefault()->getBoolForKey( "sound" ) ) { string path = "data/audio/" + pDataSkill->skill_sound; CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect(path.c_str(), false); } CCPoint pos = getPosition(); g_pFightGroundLayer->addChild( pEmitter, 100, FIRE_BALL_TAG ); pEmitter->runAction( CCSequence::actions( to1, pCallBack, NULL ) ); m_iState = CPET_STATE_NONE; } } }