Exemple #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (name.Text != "")
     {
         Player1 = name.Text;
         i       = new Player();
         i.Ime   = Player1;
         i.Poeni = 0;
         i.Mode  = comboBox1.SelectedItem.ToString();
         if (i.Mode.Equals("Medium"))
         {
             firstForm = new FirstPart();
             firstForm.Show();
         }
         else if (i.Mode.Equals("Easy"))
         {
             firstFormEasy = new FirstPartEasy();
             firstFormEasy.Show();
         }
         else
         {
             firstFormHard = new FirstPartHard();
             firstFormHard.Show();
             firstFormHard.Location = this.Location;
         }
         this.Hide();
     }
 }
Exemple #2
0
        public void GameOver()
        {
            timer.Stop();
            DialogResult dialog = MessageBox.Show("End of the game\n\nTotal points:" + FirstPart.points + " ", "Do you want to play again?", MessageBoxButtons.YesNo);

            if (dialog == DialogResult.Yes)
            {
                form1 = new FirstPart();
                this.Close();
                form1.Show();
            }
            else if (dialog == DialogResult.No)
            {
                Application.Exit();
            }
        }