Esempio n. 1
0
        /*** Sets up the start of a new game ***/
        private void startNewGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reset counter
            lettersWrongCounter = 0;

            // Make Give Up menu button visible and enable
            giveUpToolStripMenuItem.Visible = true;
            giveUpToolStripMenuItem.Enabled = true;

            // Hide give me a hint button and enable
            giveMeAHintToolStripMenuItem.Visible = false;
            giveMeAHintToolStripMenuItem.Enabled = true;

            // Hide next instruction button
            nextInstructionButton.Visible = false;

            // Hide URL source link
            textSourceLink.Visible = false;

            // Enable all letter buttons and turn then green
            enableLetterButtons();
            turnLetterButtonsGreen();

            // Select a new SercetWord
            clearSecretWordDisplay();
            wordFile.SecretWord = wordFile.selectRandomSecretWord();

            ///// Test code: Set SecretWord to know value for testing
            // wordFile.SecretWord = "happy";

            // Set variables to process new game
            lettersRemainingCounter = wordFile.SecretWord.Length;
            statusLabel.Text        = string.Format("Your new word has {0} letters", wordFile.SecretWord.Length);

            // Fill word label array with all blanks
            makeBlankDisplayVisible();

            // Reset hanging man image
            drawingPictureBox.Image = Properties.Resources.Man0;
        }