// We have only Update method for explosions, because drawing of explosion is mantained by particles and lights itself public bool Update() { if (m_explosionCue != null && m_explosionCue.Value.IsPlaying) { MyAudio.CalculateOcclusion(m_explosionCue.Value, m_explosionSphere.Center); } m_elapsedMiliseconds += MyConstants.PHYSICS_STEP_SIZE_IN_MILLISECONDS; if (m_elapsedMiliseconds >= m_lifespanInMiliseconds) { if (DEBUG_EXPLOSIONS) { return(true); } else { Close(); return(false); } } if (m_light != null) { float normalizedTimeElapsed = 1 - (float)m_elapsedMiliseconds / (float)m_lifespanInMiliseconds; m_light.Color = MyExplosionsConstants.EXPLOSION_LIGHT_COLOR * normalizedTimeElapsed; m_light.Range = /*MyMwcUtils.GetRandomFloat(0.9f, 1.0f) */ Math.Min(m_explosionSphere.Radius * 2.0f, MyLightsConstants.MAX_POINTLIGHT_RADIUS); } return(true); }