Exemple #1
0
        private void GameOver()
        {
            Player player = new Player();

            player.Score = this.score;

            this.formGame.Close();

            if (ScoreBoard.TestaScoreSuficiente(score))
            {
                //chamar o form do game over
                FormGameOver formGameOver = new FormGameOver();
                formGameOver.PlayerScore = this.score.ToString();

                DialogResult res = formGameOver.ShowDialog();

                if (res == DialogResult.OK)
                {
                    player.Nome = formGameOver.PlayerName;
                }

                //cria um player com o nome inserido e o score obitido
                ScoreBoard.InsereNoBoard(player);
                //ou faz isso no form mesmo
            }

            this.score = 0;
        }
Exemple #2
0
        public void GameOver()
        {
            FormGameField.gameState = false;
            FormGameOver formGameOver = new FormGameOver();
            DialogResult dr           = formGameOver.ShowDialog();

            if (dr == DialogResult.Abort)
            {
                formGameField.Close();

                if (DevMode)
                {
                    formDevMode.Close();
                }

                ResetGame(false);
            }
            else if (dr == DialogResult.Retry)
            {
                FormGameField.gameState = true;
                ResetGame(true);
            }
        }