22 Aralık 2012 Cumartesi

CARS RICE 5 (NEW) c#


DOWLOAD LINK http://turbobit.net/i2ddhdnostop.html

//Başla buton yazılacak kodlar:

timer1.Enabled = true;

//Program içeriği ve olayın geçtiği yer timer dır .

//Zaman artıkça Pictureboxlar hareket edecekler

//Timer1 yazılacak kodlar şunlardır ;
private void timer1_Tick(object sender, EventArgs e)
{
if (pictureBox1.Right <= panel1.Left && pictureBox2.Right <= panel1.Left && pictureBox3.Right <= panel1.Left && pictureBox4.Right <= panel1.Left)

{
Random r1 = new Random(); // random ile değişkenler

int i = 0;
int[] resim = new int[5];  // değişkenimiz 5 kadar

for (i = 0; i <= 4; i++)  // for döngüsü sokuyoruz

{
resim[i] = r1.Next(1, 15); // resimlerin hareketi

}
pictureBox1.Left = pictureBox1.Left + resim[0];
pictureBox2.Left = pictureBox1.Left + resim[1];
pictureBox3.Left = pictureBox1.Left + resim[2];
pictureBox4.Left = pictureBox1.Left + resim[3];

}
else
{
timer1.Enabled =false;

}

}

Hiç yorum yok:

Yorum Gönder