title: How do you use for loops with arrays properly?
body: <p>I am trying to create a program that creates good and bad collectibles and the characters have to find them. </p>
  
  <p>Initialize:</p>
  
  <pre><code>{
      int width = GraphicsDevice.Viewport.Width;
  
      int height = GraphicsDevice.Viewport.Height;
      int xcoord = rnd.Next(width - 50);
      int ycoord = rnd.Next(height - 50);
      this.goodCollectibles = new Sprite[gC];
      this.badCollectibles = new Sprite[bC];
      for (int index = 0; index &lt; gC; index++)
        goodCollectibles[index] = new Sprite(this, xcoord, ycoord, 50, 50, "gC");
  
      for (int index = 0; index &lt; bC; index++)
        badCollectibles[index] = new Sprite(this, xcoord, ycoord, 50, 50, "bC");
  
      char1 = new ControllableSprite(this, xcoord, ycoord, 100, 100, "char1");
      char2 = new ControllableSprite(this, xcoord, ycoord, 100, 100, "char2");
  }
  </code></pre>
  
  <p>Draw <em>if you win the game (by collecting more good collectibles/ less bad collectibles you become blue, if tie yellow, if you lose then red)</em>:</p>
  
  <pre><code>{
     spriteBatch.Begin();
  
     for (int index = 0; index &lt; gC; index++)
        goodCollectibles[index].Draw(spriteBatch);
     for (int index = 0; index &lt; bC; index++)
        badCollectibles[index].Draw(spriteBatch);
  
     if (char1.score &gt; char2.score &amp;&amp; counter &gt; 1800)
     {
        char1.scoreColor = Color.Blue;
        char2.scoreColor = Color.Red;
     }
     else if (char2.score &gt; char1.score &amp;&amp; counter &gt; 1800)
     {
        char2.scoreColor = Color.Blue;
        char1.scoreColor = Color.Red;
     }
     else if (char1.score == char2.score &amp;&amp; counter &gt; 1800)
     {
        char1.scoreColor = Color.Yellow;
        char2.scoreColor = Color.Yellow;
     }
  }
  </code></pre>