Beispiel #1
0
 /// <summary>
 /// Called when the enemy has been killed.
 /// </summary>
 public void OnKilled(Fireball killedBy)
 {
     if (Health == 0)
     {
         isAlive = false;
         sprite.PlayAnimation(dieAnimation);
     }
     else
     {
         Health--;
     }
 }
Beispiel #2
0
 private void ShootFireball(GameScreen screen)
 {
     if (isFiring)
     {
         sprite.PlayAnimation(runAnimation);
         Fireball f = new Fireball(screen, Level, "enemyfire");
         //f.loadContent();
         if ((int)direction == 1)
         {
             f.Fire(screen, new Vector2(Position.X + 10, Position.Y - 25),
                    new Vector2(200, 200), new Vector2(1, 0), "enemyfire");
         }
         else
         {
             f.Fire(screen, new Vector2(Position.X - 25, Position.Y - 25),
                    new Vector2(200, 200), new Vector2(-1, 0), "enemyfire");
         }
         mFireballs.Add(f);
     }
 }
Beispiel #3
0
 private void ShootFireball(GameScreen screen)
 {
     if (isFiring && (numFireBalls > 0))
     {
         sprite.PlayAnimation(fireAnimation);
         Fireball f = new Fireball(screen, Level, "");
         //f.loadContent();
         if (flip == SpriteEffects.FlipHorizontally)
         {
             f.Fire(screen, new Vector2(Position.X + 10, Position.Y - 25),
                    new Vector2(200, 200), new Vector2(1, 0), "");
         }
         else
         {
             f.Fire(screen, new Vector2(Position.X - 25, Position.Y - 25),
                    new Vector2(200, 200), new Vector2(-1, 0), "");
         }
         mFireballs.Add(f);
         numFireBalls--;
     }
 }
Beispiel #4
0
 /// <summary>
 /// Called when the enemy is killed.
 /// </summary>
 /// <param name="killedBy">
 /// The fireball which touch the enemy. This is null if the enemy was not killed by a
 /// fireball
 /// </param>
 private void OnEnemyKilled(Fireball killedBy)
 {
     OnKilled(killedBy);
 }
Beispiel #5
0
 private void ShootFireball(GameScreen screen)
 {
     if (isFiring)
     {
         sprite.PlayAnimation(runAnimation);
         Fireball f = new Fireball(screen, Level, "enemyfire");
         //f.loadContent();
         if ((int)direction == 1)
             f.Fire(screen, new Vector2(Position.X + 10, Position.Y - 25),
                 new Vector2(200, 200), new Vector2(1, 0), "enemyfire");
         else
             f.Fire(screen, new Vector2(Position.X - 25, Position.Y - 25),
                 new Vector2(200, 200), new Vector2(-1, 0), "enemyfire");
         mFireballs.Add(f);
     }
 }
Beispiel #6
0
 /// <summary>
 /// Called when the enemy is killed.
 /// </summary>
 /// <param name="killedBy">
 /// The fireball which touch the enemy. This is null if the enemy was not killed by a
 /// fireball
 /// </param>
 private void OnEnemyKilled(Fireball killedBy)
 {
     OnKilled(killedBy);
 }
Beispiel #7
0
 /// <summary>
 /// Called when the enemy has been killed.
 /// </summary>
 public void OnKilled(Fireball killedBy)
 {
     if (Health == 0)
     {
         isAlive = false;
         sprite.PlayAnimation(dieAnimation);
     }
     else
         Health--;
 }
Beispiel #8
0
 private void ShootFireball(GameScreen screen)
 {
     if (isFiring && (numFireBalls > 0))
     {
         sprite.PlayAnimation(fireAnimation);
         Fireball f = new Fireball(screen,Level, "");
         //f.loadContent();
         if (flip == SpriteEffects.FlipHorizontally)
             f.Fire(screen, new Vector2(Position.X + 10, Position.Y - 25),
                 new Vector2(200, 200), new Vector2(1, 0), "");
         else
             f.Fire(screen, new Vector2(Position.X - 25, Position.Y - 25),
                 new Vector2(200, 200), new Vector2(-1, 0), "");
         mFireballs.Add(f);
         numFireBalls--;
     }
 }