Ejemplo n.º 1
0
        public float TakeDamage(float damage)
        {
            int minusScore = (int)(damage * 108);

            PlayerStats.ShieldEnergy -= damage;
            PlayerStats.Score        -= minusScore;
            ShowPoints pts = new ShowPoints(-minusScore);

            pts.Position.X = Position.X;
            pts.Position.Y = Position.Y;
            SceneManager.Instance.Scene.Add(pts);
            return(PlayerStats.TotalLife);
        }
Ejemplo n.º 2
0
 private void OnBoltHit(object sender, EventArgs e)
 {
     if (e is CollisionEventArgs)
     {
         CollisionEventArgs ce = (CollisionEventArgs)e;
         if (ce.Source.Type == ObjectType.ENEMY)
         {
             PlayerStats.Score += 50;
             ShowPoints points = new ShowPoints(50);
             points.Position.X = ce.Who.Position.X;
             points.Position.Y = ce.Who.Position.Y;
             SceneManager.Instance.Scene.Add(points, 6);
             if (ce.Who is ITakeDamage && ((ITakeDamage)ce.Who).Life <= 0f)
             {
                 PlayerStats.WeaponEnergy += 5.0f;
             }
         }
     }
 }