Esempio n. 1
0
        /// <summary>
        /// Starts the game and allows for playing.
        /// </summary>
        public void StartGame()
        {
            pPlayerManager = new PaddleManager(250, 378);
            pBallManager   = new BallManager(500, 100);

            gameRunning = true;
        }
Esempio n. 2
0
        /// <summary>
        /// Ends the game and displays the score to the user. Score uploading done in the background.
        /// Name is taken from default system username.
        /// </summary>
        public void StopGame()
        {
            gameRunning = false;
            firstLoad   = false;

            if (!showOnce)
            {
                MessageBox.Show("Game over! Your score was " + pScoreManager.GetScore + " " + Environment.UserName + ".");
                pScoreManager.UploadScore(Environment.UserName);

                showOnce = true;
            }

            pPlayerManager = null;
            pBallManager   = null;
            pScoreManager  = null;
        }