[code language=”CSharp”]
public partial class Form1 : Form
{
int s1 = 0, s2 = 0, s3 = 0, y1 = 2, y2 = 2, y3 = 2;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
pictureBox7.Left = pictureBox7.Left – 10;
pictureBox9.Left = pictureBox9.Left – 10;
if (pictureBox7.Left < 204 &amp;&amp; pictureBox9.Left < 241)
{
timer1.Enabled = false;
if ( s3 == 1 &amp;&amp; y3 == 2 &amp;&amp; y1 == 2 &amp;&amp; y2 == 2||y3 == 0 &amp;&amp; s1 == 0 &amp;&amp; s2 == 0)
{
MessageBox.Show("Kurt Kuzuyu Yer", "Hata Yaptınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Visible = true;
}
if (s2 == 1 &amp;&amp; y3 == 2 &amp;&amp; y1 == 2 &amp;&amp; y2 == 2)
{
MessageBox.Show("Kuzu Lahanayı Yer","Hata Yaptınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Visible = true;
}
if (s1 == 0 &amp;&amp; s2 == 0 &amp;&amp; s3 == 0 &amp;&amp; y3 == 2 &amp;&amp; y1 == 2 &amp;&amp; y2 == 2)
{
MessageBox.Show("Kuzu Lahanayı,Kurt Kuzuyu Yer","Hata Yaptınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Visible = true;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = false;
timer2.Enabled = false;
pictureBox10.Visible = false;
button5.Visible = false;
richTextBox1.Visible = false;
}
private void button1_Click(object sender, EventArgs e)
{
if (pictureBox7.Left > 204)
{
timer1.Enabled = true;
timer2.Enabled = false;
}
if (pictureBox7.Left < 331)
{
timer2.Enabled = true;
timer1.Enabled = false;
}
}
private void timer2_Tick(object sender, EventArgs e)
{
pictureBox7.Left = pictureBox7.Left + 10;
pictureBox9.Left = pictureBox9.Left + 10;
if (pictureBox7.Left > 342 &amp;&amp; pictureBox9.Left > 378)
{
timer2.Enabled = false;
if (y3 == 0 &amp;&amp; y1 == 0)
{
MessageBox.Show("Kuzu Lahanayı Yer", "Hata Yaptınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Visible = true;
}
if (y1 == 0 &amp;&amp; y2 == 0)
{
MessageBox.Show("Kurt Kuzuyu Yer", "Hata Yaptınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Visible = true;
}
}
}
private void button4_Click(object sender, EventArgs e)
{
if (pictureBox7.Left < 204 &amp;&amp; pictureBox9.Left < 241)
{
if (s1 == 1 || s3 == 1)
{
;
}
else
{
if (s2 == 1)
{
pictureBox3.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s2 = 0;
y2 = 0;
}
else
if (s2 == 0)
{
pictureBox9.Image = pictureBox3.Image;
pictureBox3.Image = pictureBox10.Image;
s2 = 1;
y2 = 1;
}
}
}
if (pictureBox7.Left > 342 &amp;&amp; pictureBox9.Left > 378)
{
if (s1 == 1 || s3 == 1)
{
;
}
else
{
if (pictureBox6.Image == pictureBox10.Image)
{
pictureBox6.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s2 = 0;
}
else
{
pictureBox9.Image = pictureBox6.Image;
pictureBox6.Image = pictureBox10.Image;
s2 = 1;
}
}
}
}
private void pictureBox6_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
if (pictureBox7.Left < 204 &amp;&amp; pictureBox9.Left < 241)
{
if (s2 == 1 || s3 == 1)
{
;
}
else
{
if (s1 == 1)
{
pictureBox2.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s1 = 0;
y1 = 0;
}
else
if (s1 == 0)
{
pictureBox9.Image = pictureBox2.Image;
pictureBox2.Image = pictureBox10.Image;
s1 = 1;
y1 = 1;
}
}
if (y1 == 0 &amp;&amp; y2 == 0 &amp;&amp; y3 == 0)
{
MessageBox.Show("TEBRİKLER", "Başardınız");
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
button4.Enabled = false;
button5.Text = "Yeni Oyun";
button5.Visible = true;
}
}
if (pictureBox7.Left > 342 &amp;&amp; pictureBox9.Left > 378)
{
if (s2 == 1 || s3 == 1)
{
;
}
else
{
if (pictureBox5.Image == pictureBox10.Image)
{
pictureBox5.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s1 = 0;
}
else
{
pictureBox9.Image = pictureBox5.Image;
pictureBox5.Image = pictureBox10.Image;
s1 = 1;
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
if (pictureBox7.Left < 204 &amp;&amp; pictureBox9.Left < 241)
{
if (s1 == 1 || s2 == 1)
{
;
}
else
{
if (s3 == 1)
{
pictureBox1.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s3 = 0;
y3 = 0;
}
else
if (s3 == 0)
{
pictureBox9.Image = pictureBox1.Image;
pictureBox1.Image = pictureBox10.Image;
s3 = 1;
y3 = 1;
}
}
}
if (pictureBox7.Left > 342 &amp;&amp; pictureBox9.Left > 378)
{
if (s1 == 1 || s2 == 1)
{
;
}
else
{
if (pictureBox4.Image == pictureBox10.Image)
{
pictureBox4.Image = pictureBox9.Image;
pictureBox9.Image = pictureBox10.Image;
s3 = 0;
}
else
{
pictureBox9.Image = pictureBox4.Image;
pictureBox4.Image = pictureBox10.Image;
s3 = 1;
}
}
}
}
private void button5_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
timer2.Enabled = false;
button1.Enabled = true;
button2.Enabled = true;
button3.Enabled = true;
button4.Enabled = true;
richTextBox1.Visible = false;
richTextBox1.Text = "Saldaki adamın Kurt,Kuzu ve Lahana yı karşıya geçirmesine yardım et. Unutma! etrafta birisi olmadığında Kurt Kuzuyu, Kuzu Lahanayı yiyiyor.";
button5.Visible = false;
button5.Text = "Tekrar Dene!";
pictureBox7.Left = 343;
pictureBox9.Left = 379;
pictureBox4.Image = button2.Image;
pictureBox5.Image = button3.Image;
pictureBox6.Image = button4.Image;
pictureBox9.Image = pictureBox10.Image;
pictureBox1.Image = pictureBox10.Image;
pictureBox2.Image = pictureBox10.Image;
pictureBox3.Image = pictureBox10.Image;
s1 = 0;
s2 = 0;
s3 = 0;
y1 = 2;
y2 = 2;
y3 = 2;
}
private void button6_Click(object sender, EventArgs e)
{
if (richTextBox1.Visible == true) richTextBox1.Visible = false;
else
if (richTextBox1.Visible == false) richTextBox1.Visible = true;
}
}[/code]
Projeyi İNDİR

Başarılı bir çalışma olmuş ancak benim anlamadığım olay şu. Bu karşıya geçirilenler salda mı kalıyo yoksa karşıya bırakmak için bir komut varda ben mi göremedim? B ir türlü saldan indiremedim de 🙂
tmm çözdüm olayı. çalışma için tekrar tebrikler
buradaki s ve y ler ne anlama geliyor
benim anlamadığım kurt kuzu resimleri nasıl oluşturuldu. harici bir imaj dosyası yok klasörlerde