Esempio n. 1
0
        private void btnChangeGame_Click(object sender, EventArgs e)
        {
            frmGameChoice gc = new frmGameChoice(playerName);

            gc.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            frmGameChoice choice = new frmGameChoice(username);

            choice.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            guess = txtGuess.Text;
            setNewWord();

            if (numGuess == 0)
            {
                MessageBox.Show("You have run out of guesses", "Game Over");

                var playerChoice = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nWould you like to play again?", "Game Over", MessageBoxButtons.YesNo);

                if (playerChoice == DialogResult.Yes)
                {
                    frmPlayGuesstheWord gw = new frmPlayGuesstheWord(playerName);
                    gw.Show();
                    this.Hide();
                }
                else
                {
                    frmGameChoice gameC = new frmGameChoice(playerName);
                    gameC.Show();
                    this.Hide();
                }
            }
        }
Esempio n. 4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            time         = time - 1;
            lblTime.Text = time.ToString();

            if (time <= 10)
            {
                lblTime.ForeColor = System.Drawing.Color.Red;
            }

            if (time == 0)
            {
                timer1.Enabled = false;
                MessageBox.Show("You have run out of time", "Game Over");

                var playerChoice = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nWould you like to play again?", "Game Over", MessageBoxButtons.YesNo);

                if (playerChoice == DialogResult.Yes)
                {
                    frmPlayConundrum pCon = new frmPlayConundrum(playerName);
                    pCon.Show();
                    this.Hide();
                }
                else
                {
                    frmGameChoice gameC = new frmGameChoice(playerName);
                    gameC.Show();
                    this.Hide();
                }
            }
        }
Esempio n. 5
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            playerUsername = txtName.Text;

            if (playerUsername == "" || txtName.Text.Length > 8)
            {
                MessageBox.Show("Invalid user name!\n\nPlease enter a username no more than 8 characters long", "Error!");
            }
            else
            {
                frmGameChoice game = new frmGameChoice(playerUsername);
                game.Show();
                this.Hide();
            }
        }
Esempio n. 6
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            playerUsername = txtName.Text;

            if (playerUsername == "" || txtName.Text.Length > 8)
            {
                MessageBox.Show("Invalid user name!\n\nPlease enter a username no more than 8 characters long", "Error!");
            }
            else
            {
                frmGameChoice game = new frmGameChoice(playerUsername);
                game.Show();
                this.Hide();
            }
        }
Esempio n. 7
0
 private void btnExit_Click(object sender, EventArgs e)
 {
     frmGameChoice choice = new frmGameChoice(username);
     choice.Show();
     this.Hide();
 }
        private void btnEnter_Click(object sender, EventArgs e)
        {
            guess = txtGuess.Text;
            setNewWord();

            if (numGuess == 0)
            {
                MessageBox.Show("You have run out of guesses", "Game Over");

                var playerChoice = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nWould you like to play again?", "Game Over", MessageBoxButtons.YesNo);

                if (playerChoice == DialogResult.Yes)
                {
                    frmPlayGuesstheWord gw = new frmPlayGuesstheWord(playerName);
                    gw.Show();
                    this.Hide();
                }
                else
                {
                    frmGameChoice gameC = new frmGameChoice(playerName);
                    gameC.Show();
                    this.Hide();
                }
            }
        }
Esempio n. 9
0
 private void btnChangeGame_Click(object sender, EventArgs e)
 {
     frmGameChoice game = new frmGameChoice(playerName);
     game.Show();
     this.Hide();
 }
Esempio n. 10
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            time = time - 1;
            lblTime.Text = time.ToString();

            if (time <= 10)
            {
                lblTime.ForeColor = System.Drawing.Color.Red;
            }

            if (time == 0)
            {
                timer1.Enabled = false;
                MessageBox.Show("You have run out of time", "Game Over");

                var playerChoice = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nWould you like to play again?", "Game Over", MessageBoxButtons.YesNo);

                if (playerChoice == DialogResult.Yes)
                {
                    frmPlayConundrum pCon = new frmPlayConundrum(playerName);
                    pCon.Show();
                    this.Hide();
                }
                else
                {
                    frmGameChoice gameC = new frmGameChoice(playerName);
                    gameC.Show();
                    this.Hide();
                }
            }
        }