private void livesDecrement() { if (countLives == 1) { timer1.Stop(); timer2.Stop(); timer3.Stop(); timer4.Stop(); this.Hide(); formLoser = new FormLoser(); formLoser.Show(); } else { countLives--; lblLivesCount.Text = countLives.ToString(); pbSheep.Location = startingPoint; } }
private void timer4_Tick(object sender, EventArgs e) { if (!isPaused) { time--; lblTime.Text = string.Format("Time: {0}", time.ToString()); if (time == 0) { timer4.Stop(); this.Hide(); formLoser = new FormLoser(); formLoser.Show(); } if (countSheep == 5) { timer4.Stop(); this.Hide(); formWinner = new FormWinner(); formWinner.label1.Text = string.Format("Your score is: {0}", time.ToString()); formWinner.Show(); } } }