title: Space Invaders collision detection. 1 bullet check all invaders?
body: <p>I have developed a grid of invaders that I can shoot a bullet towards.</p>
  
  <p>The only solution I know of for collision detection is using two <code>Rectangles</code> and the <code>Intersects</code> method.</p>
  
  <p>Now, it is my feeling that it is not efficient to compare each bullet to every invader on the screen.</p>
  
  <p>Is there another solution I can use here that is more intelligent and only compares some invaders.</p>
  
  <p><strong>I propose</strong> to use a flag for the X axis, that is populated with the X position of the bullet when fired. The invader sprites will have access to this flag and will only run the intersects method if the invader sprite is on that X position (+/- a few px). This would greatly reduce the number of comparisons.</p>
  
  <p>Any ideas? Thanks.</p>