title: Adding rectangles to a list via a for loop and then drawing them to the screen
body: <p>I am building a basic clone of breakout using C# and XNA. All the code seems to be working well except when trying to create and draw the blocks to the screen. </p>
  
  <p>In the LoadContent() method I used a for loop I tried to add 10 rectangles to a rectangle list (just for testing) with changing X and Y values.</p>
  
  <pre><code>int xChange = 0;
  int yChange = 0;
  //loop iterates 10 times as a test
  for (int i = 0; i == 10; i++)
  {
      rectList.Add(new Rectangle(100+xChange, 200+ yChange, 40, 80));
      xChange += 100;
      yChange += 50;
  }
  </code></pre>
  
  <p>Then in the draw method I used a foreach loop to draw each of these:</p>
  
  <pre><code>foreach (Rectangle rect in rectList)
  {
      spriteBatch.Draw(block, rect,  Color.White);
  }
  </code></pre>
  
  <p>When I run this code nothing draws and I'm not sure why. Full code can be found at <a href="http://pastebin.com/TNbzgUqn" rel="nofollow">http://pastebin.com/TNbzgUqn</a>.</p>
  
  <p>EDIT: By adding a rectangle manually (not in a loop) I got a rectangle to draw. This narrows it down to the for loop in which the rectangles are added to the list.</p>
  
  <pre><code>//The code below draws, the code above does not
  Rectangle test1 = new Rectangle(200, 200, 40, 80);
  rectList.Add(test1);
  </code></pre>