public override void Update(float fDeltaTime) { base.Update(fDeltaTime); m_fLiveTime += fDeltaTime; // If the target is no longer enabled, that means it hit the base, // which means this projectile should just go away. if (!m_Target.Enabled) { GameState.Get().RemoveGameObject(this, true); } // Move towards target Position = Vector3.Lerp(Position, m_Target.Position, m_fLiveTime / Balance.ProjectileTower[m_Level - 1].ReloadTime); // Once we reach the target, deal damage // Don't check against bounding sphere because otherwise really big enemies will quickly intersect if (Vector3.Distance(Position, m_Target.Position) < 0.05f) { GameState.Get().RemoveGameObject(this, true); m_Target.TakeDamage(m_Level * Balance.ProjectileTower[m_Level - 1].Damage); } }