Exemple #1
0
 public override void Update(GameTime gameTime)
 {
     if (Vector3.Distance(Program.Game.Player.PhysicsObject.Position, originalPosition) < doorRadius)
     {
         if (lineJoint.Motor.Settings.Servo.Goal == lineJoint.Limit.Minimum)
         {
             MediaSystem.PlaySoundEffect(SFXOptions.Win);
         }
         lineJoint.Motor.Settings.Servo.Goal = lineJoint.Limit.Maximum;
     }
     else
     {
         if (lineJoint.Motor.Settings.Servo.Goal == lineJoint.Limit.Maximum)
         {
             MediaSystem.PlaySoundEffect(SFXOptions.Fail);
         }
         lineJoint.Motor.Settings.Servo.Goal = lineJoint.Limit.Minimum;
     }
 }
Exemple #2
0
        public virtual void Damage(float amount, Actor attacker)
        {
            if (this is Player)
            {
                MediaSystem.PlaySoundEffect(SFXOptions.Explosion);
            }
            else
            {
                MediaSystem.PlaySoundEffect(SFXOptions.Achievement);
            }

            Health -= amount;
            if (Health < 0)
            {
                Health = 0;
            }

            if (Health == 0)
            {
                OnDeath(attacker);
            }
        }