title: XNA How to make an object invisible
body: <p>I'm making a 2D Shooter game in XNA. I had been working on the shooting speed of the player (Every how often can the player shoot another bullet) and made it so that the player can only shoot again once the previous bullet has traveled a certain distance like so:</p>
  
  <pre><code>if (this.bulletList[0].BULLETS[(this.bulletList[0].BULLETS.Count) - 1].X &gt;= Pos.X + attackSpeed)
                  canShoot = true;
  </code></pre>
  
  <p>Where bulletList is the available Projectiles the player can shoot, BULLETS is the List of Bullets already shot, and attackSpeed is the rate in which the bullets should be shot, or simply put: the distance the bullet has to travel until another bullet can be shot.</p>
  
  <p>Now I've been working on Collisions. My method was to dispose of a bullet after it hits a target like so:</p>
  
  <pre><code>for (int i = 0; i &lt; player.BULLETLIST[0].BULLETS.Count; i++)
          {
              if (CollisionManager.PlayerBulletOnBot(player.BULLETLIST[0].BULLETS[i], bot))
                  player.BULLETLIST[0].BULLETS.RemoveAt(i);
          }
  </code></pre>
  
  <p>Problem is, if the bullet has been removed upon hitting a target, I can no longer ask if that bullet has passed the given distance for another bullet to be shot.
  To solve that, I'd like the bullet to turn <strong>invisible</strong> upon hit, and afterwards it'll be disposed of in another function that's already been made.</p>