title: How to permanently delete enemy sprites in XNA
body: <p>I am new to XNA 4.0 and am trying to make a Super Mario Bros. type game where the player jumps down on the enemies to kill them. However I have run into a problem with killing the enemies. I have made a rectangle 15px below my character (<code>rectangleBox</code>) so that if it intersects with the enemy rectangle it will cause the <code>enemy.alive = false</code>. And if this <code>enemy.alive = false</code> it will not draw the enemy. However this only applies in the time when the rectangles intersect. Once the enemy leaves the bounds of the <code>rectangleBox</code> it appears again. How do I permanently delete the enemy so it will not respawn again until I have restarted the game?</p>
  
  <p>Enemy class code: </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using Microsoft.Xna.Framework;
  using Microsoft.Xna.Framework.Audio;
  using Microsoft.Xna.Framework.Content;
  using Microsoft.Xna.Framework.GamerServices;
  using Microsoft.Xna.Framework.Graphics;
  using Microsoft.Xna.Framework.Input;
  using Microsoft.Xna.Framework.Media;
  
  namespace notDMIG
  {
      class Enemy
      {
          public Texture2D texture;
          public Rectangle bounds;
          public Vector2 position;
          public Vector2 velocity;
          public float timer = 0.0f;
          public int spriteNum = 1;
          public int maxSpriteNum;
          public bool alive;
  
          public Enemy(Texture2D Texture, Vector2 Position, Vector2 Velocity, int maxsprites)
          {
              texture = Texture;
              position = Position;
              velocity = Velocity;
              maxSpriteNum = maxsprites;
              alive = false;
          }
      }
  }
  </code></pre>
  
  <p>Game1.cs enemy related code</p>
  
  <pre><code>protected override void Update(GameTime gameTime)
  {
      foreach (Enemy enemy in Enemies)
      {
          enemy.alive = true;
  
          Rectangle rectangleBox = new Rectangle((int)player.position.X, (int)player.position.Y + player.sprite.Height + 15, player.sprite.Width, 1);
          Rectangle enemyBox = new Rectangle((int)enemy.position.X, (int)enemy.position.Y, enemy.texture.Width, enemy.texture.Height);
  
          if (enemy.alive == true)
          {
              if (rectangleBox.Intersects(enemyBox))
              {
                  enemy.alive = false;
  
                  continue;
              }
          }
      }
  }
  
  protected override void Draw(GameTime gameTime)
  {
      foreach (Enemy enemy in Enemies)
      {
          if (enemy.alive == true)
          {
              spriteBatch.Draw(enemy.texture, enemy.position, Color.White);
          }
      }
  }
  </code></pre>