Beispiel #1
0
        private void CheckScore()
        {
            if (score == 10)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score10;
            }
            if (score == 20)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score20;
            }
            if (score == 30)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score30;
            }
            if (score == 40)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score40;
            }
            if (score == 50)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score50;
            }
            if (score == 60)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score60;
            }
            if (score == 70)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score70;
            }
            if (score == 80)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score80;
            }
            if (score == 90)
            {
                pictureBox5.BackgroundImage = Properties.Resources.score90;
            }


            if (score == 100)
            {
                tmrGood.Enabled      = false;
                tmrBad.Enabled       = false;
                tmrCountdown.Enabled = false;
                MessageBox.Show("level completed");
                pictureBox5.BackgroundImage = Properties.Resources.score100;
                level = 2;


                this.Hide();                //the form disappears
                change1 c1 = new change1(); //creates a new level form and opens it
                c1.ShowDialog();            //this shows the form as a modal dialog box.
                this.Close();               //this closes the form to complete the form change
            }
        }
Beispiel #2
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            SetValueForText1 = textBox1.Text;

            this.Hide();                   //the form disappears
            change1 water = new change1(); //creates a new level form and opens it

            water.ShowDialog();            //this shows the form as a modal dialog box.
            this.Close();                  //this closes the form to complete the form change
        }
Beispiel #3
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            tmrGood.Enabled      = false;
            tmrBad.Enabled       = false;
            tmrCountdown.Enabled = false;
            level = 3;

            this.Hide();                //the form disappears
            change1 c1 = new change1(); //creates a new level form and opens it

            c1.ShowDialog();            //this shows the form as a modal dialog box.
            this.Close();               //this closes the form to complete the form change
        }
Beispiel #4
0
        private void CheckLives()
        {
            if (lives == 10)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives10;
            }
            if (lives == 9)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives9;
            }
            if (lives == 8)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives8;
            }
            if (lives == 7)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives7;
            }

            if (lives == 6)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives6;
            }
            if (lives == 5)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives5;
            }

            if (lives == 4)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives4;
            }

            if (lives == 3)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives3;
            }

            if (lives == 2)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives2;
            }

            if (lives == 1)
            {
                pictureBox6.BackgroundImage = Properties.Resources.lives1;
            }
            if (lives == 0)
            {
                tmrGood.Enabled      = false;
                tmrBad.Enabled       = false;
                tmrCountdown.Enabled = false;
                MessageBox.Show("Game Over");
                pictureBox6.BackgroundImage = Properties.Resources.lives;

                level = 3;

                this.Hide();                //the form disappears
                change1 c1 = new change1(); //creates a new level form and opens it
                c1.ShowDialog();            //this shows the form as a modal dialog box.
                this.Close();               //this closes the form to complete the form change
            }
        }