Пример #1
0
 private void timer3_Tick(object sender, EventArgs e)
 {
     if (n > 0)
     {
         n--;
     }
     else
     {
         timer3.Stop();
         MessageBox.Show("Time Out!");
         n = 90;
         state2 p = new  state2();
         p.Show();
         this.Hide();
     }
     stpt.Text = n.ToString();
 }
Пример #2
0
 protected void timer2_Tick(object sender, EventArgs e)
 {
     if (meatbox.Bounds.IntersectsWith(ak1.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak2.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak3.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak4.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak5.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak6.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak7.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak8.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak8.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak10.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak11.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(ak12.Bounds))
     {
         meatbox.Top  = 25;
         meatbox.Left = 25;
     }
     else if (meatbox.Bounds.IntersectsWith(Goal.Bounds))
     {
         timer1.Stop();
         timer2.Stop();
         timer3.Stop();
         MessageBox.Show("Next state !");
         n            = 91;
         meatbox.Top  = 25;
         meatbox.Left = 25;
         state2 a = new state2();
         a.Show();
         this.Hide();
     }
 }