private void Dpower_Tick(object sender, EventArgs e) { pictureBox4.Visible = false; pictureBox2.Visible = true; timer1.Start(); Dpower.Stop(); }
private void timer1_Tick(object sender, EventArgs e) { progressBar4.Increment(1); if (progressBar4.Value == 100) { pictureBox2.Visible = false; pictureBox4.Visible = true; Dpower.Start(); int loc = RandGen(); if (loc == 0) { pictureBox4.Location = new Point(-43, 287); } else if (loc == 1) { pictureBox4.Location = new Point(-43, 88); } else { pictureBox4.Location = new Point(-43, 33); } // pictureBox2.Visible = false; progressBar4.Value = 0; if (pictureBox4.Bounds.IntersectsWith(pictureBox1.Bounds)) { try { progressBar1.Value -= 10; } catch (ArgumentOutOfRangeException) { reset(); MessageBox.Show("Dragon Wins"); log("Dragon"); restart_Form(); } } timer2.Start(); timer1.Stop(); } progressBar3.Increment(1); }