private void Picexit_Click(object sender, EventArgs e) { TM_NguoiHung.Dispose(); TM_CotTruyen.Dispose(); TM_BiaVang.Dispose(); TM_RanDom.Dispose(); Application.Exit(); }
private void TM_BiaVang_Tick(object sender, EventArgs e) { foreach (Control x in this.Controls) { if (x is PictureBox && x.Tag == "beer" && x.Visible == true) { if (x.Top > 615) { x.Top = 12; TM_RanDom.Start(); } else { x.Top += speed; if (x.Top > 300) { hotro.picbiavo(x.Left).Visible = false; } } } if (x is PictureBox && x.Tag == "beer") { if (x.Bounds.IntersectsWith(pic_nguoi.Bounds)) { x.Top = 12; TM_RanDom.Start(); score++; } if (x.Top >= 590) { x.Top = 12; TM_RanDom.Start(); miss++; this.Controls.Add(hotro.picbiavo(x.Left)); } } speed = hotro.tangtocdo(score, speed); lbl_score.Text = "Score :" + score; lbl_miss.Text = "Missed :" + miss; if (miss >= 5) { TM_BiaVang.Dispose(); TM_NguoiHung.Dispose(); TM_RanDom.Dispose(); GameOver(); } } }