How to assign integers to objects in a list?
<p>So I've got objects in a list, and I'm trying to assign an angle to each to travel at. Currently I've got two lists:</p>

<pre><code>List&lt;double&gt; BulletAngles = new List&lt;double&gt;();
List&lt;OvalShape&gt; Bullets = new List&lt;OvalShape&gt;();
</code></pre>

<p>My view on how lists work is obviously very off. Right now the bullets are traveling based on this code:</p>

<pre><code>foreach (OvalShape b in Bullets)
{
      int i = Bullets.IndexOf(b);
      if (b.Location.X &gt; -10 &amp;&amp; b.Location.X &lt; (this.Width - 6) + 10
      &amp;&amp; b.Location.Y &gt; -10 &amp;&amp; b.Location.Y &lt; (this.Height - 30) + 10)
      {
          b.Left += Convert.ToInt32(bulletSpeed * Math.Cos(BulletAngles[i]));
          b.Top += Convert.ToInt32(bulletSpeed * Math.Sin(BulletAngles[i]));
      }
}
</code></pre>

<p>The angle is all based on the mouses position when clicking, but when testing this, all bullets go in the direction of the first mouse click.
Here is also the code for setting the angle and placing in the bullet:</p>

<pre><code>Point target = new Point(mousePos.X - origin.X, mousePos.Y - origin.Y);
OvalShape g = Bullet;
double y = Math.Atan2(target.Y, target.X);
g.Left = origin.X - (g.Width / 2);
g.Top = origin.Y - (g.Height / 2);
g.Visible = true;
BulletAngles.Add(y);
Bullets.Add(g);
</code></pre>