Problem to move many images in c#
<p>I wanna write an application to do below job:</p>

<p>We have 15 different location (that we present them with point (x1,y1) for first location, point (x1,y2) for second location and so on point (x1,y15) for last location).</p>

<p>100 image must to be shown at this locations (with specific order) with pictureBox.
Each image that shown, must start to move horizontally to reach new point (e.g. point (Xc, Yc) ) and then move vertically and so on…</p>

<p>When the image reach to specific point (e.g. point (Xm,Ym) ), we decide that it must continue moving or it must destroy (with probability 20%) (which means that we can create next  image at that initial location).</p>

<p>For example, an image create at location (Xi,Yi) with pictureBox1. Then it’s not allowed to create any more image at location (Xi,Yi) until pictureBox1 destroy or return to its initial location.</p>

<p>What I have written so far is:</p>

<ul>
<li><p>create 15 location.</p></li>
<li><p>move one image to reach point (Xc,Yc).</p></li>
</ul>

<p>I’ve some problems:</p>

<ul>
<li><p>I use one timer to move an image. But I want to move 100 images. (from each 15 location, we create images and move them until we destroy them and then create next image).
So what I must to do? Use 15 timer for each location?!but How?</p></li>
<li><p>at specific point (e.g. point (Xk,Yk) ), the image must stop moving for random seconds and then continue moving. How I should do this? With another timer?!But how?</p></li>
<li><p>when image reach point (Xc,Yc) and with we decide to destroy it or not, nothing happen in my code…I don’t know why!</p></li>
</ul>

<p>I’ve add an picture of what I want <a href="http://efreephoto.com/pictures/4879731054d4940786b73c.jpg" rel="nofollow">HERE</a></p>

<p>Here is my code so far:</p>

<pre><code>public partial class Form1 : Form
{

    Random r = new Random();

    // falg to prevent create just one image at each location
    private Boolean[] createNext = {true,true,true,true,true,true,true,
                                    true,true,true,true,true,true,true,true};

    private void setImage()
    {
        int i = 1 + r.Next() % 15;

        while (createNext[i] != true)
            i = 1 + r.Next() % 15;

        switch (i)
        {
            case 1: pictureBox1.ImageLocation = "grin.png";
                break;
            case 2: pictureBox2.ImageLocation = "grin.png";
                break;
            case 3: pictureBox3.ImageLocation = "grin.png";
                break;
            case 4: pictureBox4.ImageLocation = "grin.png";
                break;
            case 5: pictureBox5.ImageLocation = "grin.png";
                break;
            case 6: pictureBox6.ImageLocation = "grin.png";
                break;
            case 7: pictureBox7.ImageLocation = "grin.png";
                break;
            case 8: pictureBox8.ImageLocation = "grin.png";
                break;
            case 9: pictureBox9.ImageLocation = "grin.png";
                break;
            case 10: pictureBox10.ImageLocation = "grin.png";
                break;
            case 11: pictureBox11.ImageLocation = "grin.png";
                break;
            case 12: pictureBox12.ImageLocation = "grin.png";
                break;
            case 13: pictureBox13.ImageLocation = "grin.png";
                break;
            case 14: pictureBox14.ImageLocation = "grin.png";
                break;
            case 15: pictureBox15.ImageLocation = "grin.png";
                break;
        }
    }

    private int k = 0;
    private Boolean destroy = true;

    // timer that move pictureBox1
    void timer_Tick(object sender, EventArgs e)
    {
        k++;

        int x = pictureBox1.Location.X;
        int y = pictureBox1.Location.Y;

        if (k &lt;= 150)//go right 300 in 150 ticks
            pictureBox1.Location = new Point(x + 2, y);
        else if (k &lt;= 300)
        {
            if (y &lt; 200)
                pictureBox1.Location = new Point(x, y + 1);
            if (y &gt; 200)
                pictureBox1.Location = new Point(x, y - 1);
        }

        else if (k &lt;= 400)
            pictureBox1.Location = new Point(x + 2, y);

        else if (k &lt;= 550)
        {
            if (destroy == false)
                pictureBox1.Location = new Point(x + 2, y);
            if (destroy == true)
                pictureBox1.Location = new Point(x, y - 3);
        }

        else if (k &lt;= 650)
            pictureBox1.Location = new Point(x, y - 1);

        else if (k &lt;= 850)
            pictureBox1.Location = new Point(x - 2, y);

        else if (k &lt;= 950)
            pictureBox1.Location = new Point(x, y + 1);

        else
            timer1.Stop();
    }

    public Form1()
    {
        InitializeComponent();

        for (int i = 0; i &lt; 15; i++)
        {
            setImage();
            timer1.Start();
            timer1.Interval = 15;
            timer1.Tick += new EventHandler(timer_Tick);
        }
    }
</code></pre>

<p>Please help me to complete this application.</p>

<p>Thanks in advance.</p>
