private void timer3_Tick(object sender, EventArgs e) { if (n > 0) { n--; } else { timer3.Stop(); MessageBox.Show("Time Out!"); n = 90; state3 b = new state3(); b.Show(); this.Hide(); } str11.Text = n.ToString(); }
private void timer2_Tick(object sender, EventArgs e) { if (meatbox1.Bounds.IntersectsWith(bk1.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk2.Bounds)) { timer2.Stop(); bk2.Image = Properties.Resources.ghost55555; MessageBox.Show("เ_ย ผีหลอก!! หนีแปป"); meatbox1.Top = 25; meatbox1.Left = 25; timer2.Start(); } else if (meatbox1.Bounds.IntersectsWith(bk4.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk5.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk6.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk7.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk10.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk11.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk12.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk15.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk15.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk16.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk17.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk19.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk20.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(bk9.Bounds)) { timer2.Stop(); bk9.Image = Properties.Resources.wire1; MessageBox.Show("คุณโดนหนาม ชึ้ก!!!! ตายแปป"); meatbox1.Top = 25; meatbox1.Left = 25; timer2.Start(); } else if (meatbox1.Bounds.IntersectsWith(mmg.Bounds)) { meatbox1.Top = 25; meatbox1.Left = 25; } else if (meatbox1.Bounds.IntersectsWith(Goal1.Bounds)) { timer1.Stop(); timer2.Stop(); timer3.Stop(); MessageBox.Show("Next state !"); n = 91; meatbox1.Top = 25; meatbox1.Left = 25; state3 a = new state3(); a.Show(); this.Hide(); } }