Example #1
0
        public void Update(float deltaTime)
        {
            UpdateProjSpecific();

            if (!character.IsDead)
            {
                damage = Math.Max(0.0f, damage - deltaTime * 0.1f);
            }
            if (burnt > 0.0f)
            {
                Burnt -= deltaTime;
            }

            if (LinearVelocity.X > 500.0f)
            {
                //DebugConsole.ThrowError("CHARACTER EXPLODED");
                body.ResetDynamics();
                body.SetTransform(character.SimPosition, 0.0f);
            }

            if (inWater)
            {
                body.ApplyWaterForces();
            }

            if (isSevered)
            {
                severedFadeOutTimer += deltaTime;
                if (severedFadeOutTimer > SeveredFadeOutTime)
                {
                    body.Enabled = false;
                }
            }

            if (character.IsDead)
            {
                return;
            }

            damage      = Math.Max(0.0f, damage - deltaTime * 0.1f);
            SoundTimer -= deltaTime;
        }