官术网_书友最值得收藏!

Time for action – updating the Initialize() method

  1. Update the Initialize() method to include the following:
    Me.IsMouseVisible = True
    Me.graphics.PreferredBackBufferWidth = 800
    Me.graphics.PreferredBackBufferHeight = 600
    graphics.ApplyChanges()
  2. Update the LoadContent() method to include the following after three texture files have been loaded:
    _gameBoard = New GameBoard(playingPieces, EmptyPiece)

What just happened?

After making the mouse cursor visible, we set the size of the BackBuffer to 800x600 pixels. On Windows, this will size the game window to 800x600 pixels as well.

The constructor for the GameBoard class calls the ClearBoard() method, so each of the pieces on the _gameBoard instance will be set to Empty.

The Draw() method – the title screen

In the declarations section, we established two possible game states. The first (and default) state is GameStates.TitleScreen, indicating that the game should not be processing actual game play, but should instead be displaying the game's logo and waiting for the user to begin the game.

主站蜘蛛池模板: 肥西县| 平舆县| 阜新市| 准格尔旗| 霍邱县| 寿宁县| 和平县| 莒南县| 辽宁省| 中阳县| 平远县| 前郭尔| 长沙县| 股票| 临泽县| 宁都县| 乐至县| 西吉县| 英山县| 淳化县| 石嘴山市| 东宁县| 荥阳市| 安仁县| 泰州市| 开鲁县| 土默特左旗| 盐亭县| 屯昌县| 安徽省| 科技| 临夏县| 苏尼特左旗| 逊克县| 吉木萨尔县| 花垣县| 鄂温| 清新县| 贵定县| 巴林左旗| 夏津县|