Example #1
0
 public Hangman()
 {
     hangmanFile         = new HangmanFile();
     hangmanWord         = new HangmanWord(hangmanFile.GetWordFromWordList());
     numberOfGuesses     = 6 + hangmanWord.ToGuess.Length;
     currentIndexGuessed = 0;
     livesRemaining      = 6;
     lettersGuessed      = new char[numberOfGuesses];
     Guessed             = false;
 }
Example #2
0
        private void newGame()
        {
            ResetLetters();
            Random r = new Random();

            int index = r.Next(dataWords.getWords(level).Count);

            hangmanWord = new HangmanWord(dataWords.getWords(level)[index]);
            updateWordMask();
            timeElapsed = 0;
            timer1.Start();
            pgbLife.Maximum = TIME;
            pgbLife.Value   = TIME;
            picuterBox.Load("../../Resources/pictures/Gallows0.jpg");
        }
Example #3
0
 /// <summary>
 /// Метод за стартување на нова игра.
 /// </summary>
 private void newGame()
 {
     hangmanWord = new HangmanWord(wordSelector.pick());
     updateWordMask();
     updateGuessedLetters();
     timeElapsed = 0;
     updateTime();
     timer1.Start();
     pbTime.Maximum   = TIME;
     pbTime.Value     = TIME;
     pbWrong.Value    = hangmanWord.WrongCount;
     pbWrong.Maximum  = HangmanWord.MAX_WRONG_COUNT;
     tbLetter.Enabled = true;
     btnOK.Enabled    = true;
 }
Example #4
0
File: Form1.cs Project: zajuruk/VP
        /// <summary>
        /// Метод за стартување на нова игра.
        /// </summary>
        private void newGame()
        {
            Random r     = new Random();
            int    index = r.Next(words.Length);

            hangmanWord = new HangmanWord(words[index]);
            updateWordMask();
            updateGuessedLetters();
            timeElapsed = 0;
            updateTime();
            timer1.Start();
            pbTime.Maximum   = TIME;
            pbTime.Value     = TIME;
            pbWrong.Value    = hangmanWord.WrongCount;
            pbWrong.Maximum  = HangmanWord.MAX_WRONG_COUNT;
            tbLetter.Enabled = true;
            btnOK.Enabled    = true;
        }
Example #5
0
        public void newGame()
        {
            seconds    = 10 * 60;
            wordPicker = new WordPicker();
            String word = wordPicker.pickNextWord();

            hangman           = new HangmanWord(word);
            wordGuess.Text    = hangman.refreshGuessed();
            triedLetters.Text = hangman.refreshTotalLetters();
            tbGuess.Clear();
            pbTimer.Minimum        = 0;
            pbTimer.Maximum        = 10 * 60;
            pbTimer.Value          = 10 * 60;
            pbWrongCounter.Minimum = 0;
            pbWrongCounter.Maximum = HangmanWord.MAX_GUESSES;
            pbWrongCounter.Value   = 0;
            timerTime.Start();
        }
Example #6
0
File: Form1.cs Project: AtanasK/VP
 /// <summary>
 /// Метод за стартување на нова игра.
 /// </summary>
 private void newGame()
 {
     Random r = new Random();
     int index = r.Next(words.Length);
     hangmanWord = new HangmanWord(words[index]);
     updateWordMask();
     updateGuessedLetters();
     timeElapsed = 0;
     updateTime();
     timer1.Start();
     pbTime.Maximum = TIME;
     pbTime.Value = TIME;
     pbWrong.Value = hangmanWord.WrongCount;
     pbWrong.Maximum = HangmanWord .MAX_WRONG_COUNT;
     tbLetter.Enabled = true;
     btnOK.Enabled = true;
 }
Example #7
0
        private void newGame()
        {
            ResetLetters();
            Random r = new Random();

            int index = r.Next(dataWords.getWords(level).Count);
            hangmanWord = new HangmanWord(dataWords.getWords(level)[index]);
            updateWordMask();
            timeElapsed = 0;
            timer1.Start();
            pgbLife.Maximum = TIME;
            pgbLife.Value = TIME;
            picuterBox.Load("../../Resources/pictures/Gallows0.jpg");
        }