예제 #1
0
        public void StopGame()
        {
            tmrGame.Stop();
            tmrTime.Stop();
            ResetField();

            //eastereggs
            if (GetPoints() == 284 && _numberBoxesHorizontal == 20 && _numberBoxesVertical == 10)
            {
                Eastereggs.Celia(this);
            }
            else if (GetPoints() > 9000)
            {
                Eastereggs.Over9000();
            }

            if (GetPoints() < _gameOverAt)
            {
                MessageBox.Show("Game Over!", "Game Over!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
            else
            {
                _editScore.SetScore(Convert.ToString(GetPoints()));
                _editScore.ShowDialog();
            }

            btnStart.Text = "Spiel starten";

            btnOptions.Enabled   = true;
            btnScoreList.Enabled = true;
        }
예제 #2
0
        public void StopGame()
        {
            tmrGame.Stop();
            ResetField();

            if (Convert.ToInt32(lblPoints.Text.TrimEnd(_charsToRemove)) < 0)
            {
                MessageBox.Show("GAME OVER!", "GAME OVER!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            else
            {
                _editScore.SetScore(lblPoints.Text.TrimEnd(_charsToRemove));
                _editScore.ShowDialog();
            }

            btnStart.Text = "Spiel starten";

            btnOptions.Enabled   = true;
            btnScoreList.Enabled = true;
        }
예제 #3
0
        /// <summary>
        /// Stopped das Game und gibt bei negativem Punktestand
        /// 'Game Over!' aus. Bei positivem Punktestand wird
        /// eine Fanfare abgespielt und das Formular zur Eintragung
        /// geöffnet.
        /// </summary>
        public void StopGame()
        {
            tmrGame.Stop();
            if (_playerScore < 0)
            {
                ShowGameOverBox();
            }
            else
            {
                if (_playerScore > _scoreListForm.GetCurrentHighScore())
                {
                    using (SoundPlayer sp = new SoundPlayer(Properties.Resources.trumpet))
                    {
                        sp.Play();
                    }
                }

                _editScoreForm.SetScore(txtScore.Text);
                _editScoreForm.ShowDialog();
                _scoreListForm.RefreshScore();
            }

            _boxList[_lastFlippedButtonIndex].BackColor = _boxColor;
        }