public override void Update(GameTime pGameTime, Sprite pSprite) { m_CurrentTime += pGameTime.ElapsedGameTime.Milliseconds; float lerpFactor = 0; if (m_CurrentTime > 0) { lerpFactor = (float)m_CurrentTime / m_LerpTime; } pSprite.Colour = Color.Lerp(m_StartColour, m_EndColour, lerpFactor); }
public abstract void Update(GameTime pGameTime, Sprite pSprite);
public override void Update(GameTime pGameTime, Sprite pSprite) { pSprite.Position = pSprite.Position + Velocity * (float)pGameTime.ElapsedGameTime.Milliseconds / 1000; }
public override void Update(GameTime pGameTime, Sprite pSprite) { m_CurrentTime += pGameTime.ElapsedGameTime.Milliseconds; float lerpFactor = 0; if (m_CurrentTime > 0) { lerpFactor = (float)m_CurrentTime / m_LerpTime; } pSprite.Scale = Vector2.Lerp(m_StartScale, m_EndScale, lerpFactor); }