Example #1
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            errorCheck();

            if (radConundrum.Checked == true)
            {
                frmConundrum conundrum = new frmConundrum(playerName);
                conundrum.Show();
                this.Hide();
            }

            if (radGuesstheWord.Checked == true)
            {
                frmGuesstheWord guess = new frmGuesstheWord(playerName);
                guess.Show();
                this.Hide();
            }

            if (radUpdateWords.Checked == true)
            {
                frmAdminLogin admin = new frmAdminLogin(playerName);
                admin.Show();
                this.Hide();
            }
        }
Example #2
0
        private void btnEnter_Click(object sender, EventArgs e)
        {
            errorCheck();

            if(radConundrum.Checked == true)
            {
                frmConundrum conundrum = new frmConundrum(playerName);
                conundrum.Show();
                this.Hide();
            }

            if (radGuesstheWord.Checked == true)
            {
                frmGuesstheWord guess = new frmGuesstheWord(playerName);
                guess.Show();
                this.Hide();
            }

            if (radUpdateWords.Checked == true)
            {
                frmAdminLogin admin = new frmAdminLogin(playerName);
                admin.Show();
                this.Hide();
            }
        }
        public void setNewWord()
        {
            if (guess == words.ElementAt(indexNum))
            {
                timer1.Enabled = false;

                MessageBox.Show("Correct");
                indexNum++;
                txtGuess.Text = "";
                score++;
                time       = 30;
                hiddenWord = words.ElementAt(indexNum);

                #region
                if (indexNum == words.LongLength - 1)
                {
                    var userChoice = MessageBox.Show("You have completed Conundrum\nThere are no more words", "Congratulations", MessageBoxButtons.OK);

                    if (userChoice == DialogResult.OK)
                    {
                        var exitOption = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nYou will be returned to the menu", "Congratulations", MessageBoxButtons.OK);

                        if (exitOption == DialogResult.OK)
                        {
                            frmConundrum con = new frmConundrum(playerName);
                            con.Show();
                            this.Hide();
                        }
                    }
                }
                #endregion
                else
                {
                    lblWord.Text   = shuffle(hiddenWord.ToCharArray(), shuffleTimes);
                    timer1.Enabled = true;
                    lblScore.Text  = score.ToString();
                }
            }
            else
            {
                MessageBox.Show("Incorrect");
                txtGuess.Text = "";
            }
        }
        public void setNewWord()
        {
            if (guess == words.ElementAt(indexNum))
            {
                timer1.Enabled = false;

                MessageBox.Show("Correct");
                indexNum++;
                txtGuess.Text = "";
                score++;
                time = 30;
                hiddenWord = words.ElementAt(indexNum);

                #region
                if (indexNum == words.LongLength -1)
                {
                    var userChoice = MessageBox.Show("You have completed Conundrum\nThere are no more words", "Congratulations", MessageBoxButtons.OK);

                    if (userChoice == DialogResult.OK)
                    {
                        var exitOption = MessageBox.Show("Congratulations " + playerName + " you scored " + score + "\nYou will be returned to the menu", "Congratulations", MessageBoxButtons.OK);

                        if (exitOption == DialogResult.OK)
                        {
                            frmConundrum con = new frmConundrum(playerName);
                            con.Show();
                            this.Hide();
                        }
                    }
                }
                #endregion
                else
                {
                    lblWord.Text = shuffle(hiddenWord.ToCharArray(), shuffleTimes);
                    timer1.Enabled = true;
                    lblScore.Text = score.ToString();
                }
            }
            else
            {
                MessageBox.Show("Incorrect");
                txtGuess.Text = "";
            }
        }