本文整理汇总了C++中ParticleEffect::SetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEffect::SetPos方法的具体用法?C++ ParticleEffect::SetPos怎么用?C++ ParticleEffect::SetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect::SetPos方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void LevelEndEffect::Update(float dt)
{
local_time += time_scale * dt;
float t = math::clamp(0.0f, 1.0f, local_time);
//FPoint pos = _path.getGlobalFrame(t);
float x = _pathX.getGlobalFrame(t);
float y = _pathY.getGlobalFrame(t);
_effect->SetPos(x, y);
if( local_time > 1.0f ) {
_effect->Finish();
_effect.reset();
ParticleEffect *fallEff = gameField->_effContUp.AddEffect("EndLevel_Fall");
fallEff->SetPos(320.0f, 900.0f);
fallEff->Reset();
ParticleEffect *expEff = gameField->_effContUp.AddEffect("EndLevel_Explode");
expEff->SetPos(320.0f, 700.0f);
expEff->Reset();
gameField->TriggerBonusesFromMoves();
}
}
示例2: AcceptMessage
bool EnergyReceiver::AcceptMessage(const Message &message)
{
if(message.is("DestroyFinished"))
{
if(message.getData() == _uid)
{
if(_state == ER_ACTIVATED_BREAK) {
_state = ER_ACTIVATED_BREAK_FINISHFLY;
} else {
Assert(false);
}
return true;
}else{
//На остальных приемниках запускаем акцентирующий эффект реакции на прилет другого приемника в лут
if(!IsOrdered() && !IsActivatedByEnergy())
{
ParticleEffect *eff = 0;
eff = _effContUp.AddEffect("RecOnLoot");
eff->SetPos(FPoint(0.0f, 0.0f));
eff->Reset();
}
return false;
}
}
else if(message.is("JumpFinished", _uid))
{
ReleaseSquares();
Match3::RunFallColumn(GetIndex().x);
}
else if(message.is("Start"))
{
if(_order)
{
_order->InitAppear(100.f, 100.f);
}
ReleaseEffects();
if(message.getData() == "from_tutorial")
{
_localTime = -GameSettings::gamefield[_index]->_flySquarePauseStore;
}else{
_localTime = -gameInfo.getConstFloat("CRISTAL_DELAY_APPEAR_ON_RECIVER", 0.f);
}
ParticleEffect *eff1 = _effContDown.AddEffect("RDown");
eff1->SetPos(FPoint(0.0f, 0.0f));
_partUp = _effContUpStatic.AddEffect("RUp");
_partUp->SetPos(FPoint(0.0f, 0.0f));
_partUp->Reset();
_firstShowed = false;
_lockLiveEffectShowed = false;
_timeAppear = -0.2f;
_timerForAppearOrder = -1.f;
_state = ER_APPEAR;
_hideByThief = false;
}
return false;
}
示例3: InitCell
void LockBarrierBase::InitCell()
{
Game::Square *cell = Game::GetValidSquare(_pos.x, _pos.y);
cell->Reset();
cell->SetStone(false);
cell->ice = false;
cell->SetFake(true);
cell->SetWall(1);
cell->GetChip().Reset(true);
cell->barrierIndex = 1;
_effectCont.KillAllEffects();
ParticleEffect* eff = _effectCont.AddEffect("LockLive");
eff->SetPos(FPoint(0.f, LockBarrierBase::YOffset_LOCK));
eff->Reset();
eff->Update(100.f);
_effectCont.Update(0.f);
}
示例4: Update
void EnergyReceiver::Update(float dt)
{
if( _state == ER_INIT || !GameSettings::gamefield[_index]->IsFlyType(Game::Square::FLY_STAY))
{
return;
}
_localTime += dt;
if(_localTime < 0)
{
return;
}
_fly_offset_y = 6.0f * math::sin(_localTime * 1.2f);
float t = math::clamp(0.f, 1.f, _timeAppear);
float ampl = math::clamp(0.f, 1.f, (1.f - _timeAppear/4.f));
ampl = 60.0f * ampl * ampl; //Очень быстрое затухание
_fly_offset_y += -40.f * (1.0f - t) + ampl * math::sin(_timeAppear*math::PI - math::PI*0.5f);
_fly_offset_y *= GameSettings::SQUARE_SCALE;
if(_hideByThief)
{
if(_hideByThiefTime < 0)
{
_hideByThiefTime += dt;
}
else if(_hideByThiefTime < 1)
{
_hideByThiefTime += dt*1.5f;
if(_hideByThiefTime >= 1)
{
_hideByThiefTime = 1.F;
}
}
}
if(_firstShowed)
{
if(_timeAppear < 0) {
_timeAppear += dt;
} else {
_timeAppear += dt*1.5f;
}
if(_timeAppear >= 1.f && _state == ER_APPEAR)
{
//_timeAppear = 1.f;
_state = ER_STAND;
}
}
if(!_firstShowed && Game::activeRect.Inflated(1).Contains(GetIndex()))
{
_firstShowed = true;
//Акцентирующий эффект при первом появлении на экране
ParticleEffect *eff2 = 0;
if(IsOrdered()) {
eff2 = _effectCellCont.AddEffect("RecStartAccentLock");
} else {
eff2 = _effectCellCont.AddEffect("RecStartAccent");
}
eff2->SetPos(FPoint(0.0f, 0.0f));
eff2->Reset();
MM::manager.PlaySample("ReceiverShow");
_timerForAppearOrder = gameInfo.getConstFloat("ShowOrderOnRecDelay", 3.f);
}
if(!IsOrdered())
{
_timerForAppearOrder = 0.f;
}
else if(_timerForAppearOrder > -1)
{
if(_timerForAppearOrder > 0)
{
_timerForAppearOrder -= dt;
}else{
_timerForAppearOrder -= dt*7.f;
}
if(_timerForAppearOrder <= 0.5f)
{
if(IsOrdered() && !_lockLiveEffectShowed)
{
ParticleEffect* eff = _effectCellCont.AddEffect("LockLive");
eff->SetPos(FPoint(0.f, LockBarrierBase::YOffset_LOCK));
eff->Reset();
_effectCellCont.Update(0.f);
_order->InitAppear(0.8f, 0.7f);
_lockLiveEffectShowed = true;
MM::manager.PlaySample("ReceiverOrderAppear");
}
}
if(_timerForAppearOrder < -1)
{
_timerForAppearOrder = -1;
}
}
if(_order)
{
//.........这里部分代码省略.........