Example #1
0
void Flash::update()
{
  for (auto it = m_damageNumbers.begin(); it != m_damageNumbers.end();)
  {
    it->color.a = 255 - (2 * it->life);
    it->life++;
    if (it->life == 32)
    {
      it = m_damageNumbers.erase(it);
    }
    else
    {
      ++it;
    }
  }

  if (isFlashing())
  {
    m_ticks++;
    if (m_ticks >= m_speed)
    {
      m_currentFlash++;
      m_ticks = 0;
    }
  }

  if (isFading())
  {
    m_fadeCounter -= m_fadeSpeed;
  }

  if (activeEffect())
  {
    if (!m_activeEffect->complete())
    {
      m_activeEffect->update();
    }
    else
    {
      delete m_activeEffect;
      m_activeEffect = 0;
    }
  }
}
Example #2
0
bool PGE_Fader::isNull()
{
    return ((cur_ratio<=0.0f) && (!isFading()));
}
Example #3
0
bool PGE_Fader::isFull()
{
    return ((cur_ratio>=1.0f) && (!isFading()));
}