Example #1
0
        /// <summary>
        /// Starts a game
        /// </summary>
        void StartGame()
        {
            // Increment 5: randomly generate new number for game
            secretNumber = rand.Next(1, 10);

            // Increment 5: create the board object
            numberBoard = new NumberBoard(Content, new Vector2(WindowWidth / 6, WindowHeight / 20), 9 * WindowHeight / 10, secretNumber);
        }
Example #2
0
        /// <summary>
        /// Starts a game
        /// </summary>
        void StartGame()
        {
            // Increment 5: randomly generate new number for game
            int correctNumber = random.Next(1, 10);

            // Increment 5: create the board object
            numberBoard = new NumberBoard(new ContentManager(Content.ServiceProvider, Content.RootDirectory),
                                          new Vector2(WindowWidth / 2, WindowHeight / 2),
                                          WindowHeight / (WindowHeight / 100) * (WindowHeight / 100 - 1),
                                          correctNumber);
        }
Example #3
0
        /// <summary>
        /// Starts a game
        /// </summary>
        void StartGame()
        {
            // Increment 5: randomly generate new number for game
            int correctNumber = rnd.Next(1, 10);

            // Increment 5: create the board object
            Vector2 center = new Vector2(graphics.PreferredBackBufferWidth / 2,
                                         graphics.PreferredBackBufferHeight / 2);
            int size = (int)(graphics.PreferredBackBufferHeight * 0.9f);

            numberBoard = new NumberBoard(Content, center, size, correctNumber);
            newGameSound.Play();
        }
        /// <summary>
        /// Starts a game
        /// </summary>
        void StartGame()
        {
            // Increment 5: randomly generate new number for game
            int correctNumber = rand.Next(1, 10);

            // Increment 5: create the board object
            int     boardSideLength  = windowHeight - 50;
            int     boardSideCenterX = windowWidth / 2;
            int     boardSideCenterY = windowHeight / 2;
            Vector2 boardToCenter    = new Vector2(boardSideCenterX, boardSideCenterY);

            //create the numberboard center of the screen
            numberboard = new NumberBoard(Content, boardToCenter, boardSideLength, correctNumber);
        }