Exemplo n.º 1
0
 /// <summary>
 /// Method executed when the player is hit by a enemy bullet.
 /// </summary>
 /// <param name="b">The bullet hitting the player.</param>
 public void Hit(Bullet b)
 {
     if(Status == PlayerStatus.Playing)
     {
         Power -= b.BulletPower;
         UpdateHealth();
         if(Power <= 0)
         {
             spriteIndex = 0;
             Status = PlayerStatus.Dying;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Method executed when the enemey is hit by a player bullet.
 /// </summary>
 /// <param name="bullet">The bullet hitting the plane.</param>
 public void Hit(Bullet b)
 {
     if(Status == EnemyStatus.Moving)
     {
         power -= b.BulletPower;
         if(power <= 0)
         {
             Status = EnemyStatus.Dying;
             spriteTick = 0;
         }
     }
 }