- XNA 4 3D Game Development by Example:Beginner's Guide
- Kurt Jaegers
- 238字
- 2021-08-05 18:55:25
The Game1 constructor
The Game1
class has a simple constructor with no parameters. An instance of this class will be created by the shell contained in the Program.cs
file within the project when the game is launched.
Tip
The Program.cs file
When your XNA game starts, the Main()
method in the Program.cs
file is what actually gets executed. This method creates an instance of your Game1
class and calls the Run()
method, which performs the initialization we will discuss shortly. It then begins executing the game loop, updating and drawing your game repeatedly until the program exits. In many games, we will not have to worry about Program.cs
, but there are some instances (combining XNA and Windows Forms, for example) when it is necessary to make changes here.
By default, the constructor has created an instance of the GraphicsDeviceManager
class to store in the graphics
member, and has established the base directory for the Content
object, which is an instance of the ContentManager
class.
When we build our project, all of the items in the content project are translated into a format specific to XNA, with the .xnb
file extension. These are then copied to the Content
folder in the same directory as our game's executable file.
Our Speller game will not need to make any changes to the class constructor, so we will simply move on to the next method that is called when our game starts.
- 輕松學大數據挖掘:算法、場景與數據產品
- Architects of Intelligence
- 大數據架構和算法實現之路:電商系統的技術實戰
- 數據挖掘原理與SPSS Clementine應用寶典
- 重復數據刪除技術:面向大數據管理的縮減技術
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- R Machine Learning Essentials
- Hands-On System Programming with C++
- 數據庫查詢優化器的藝術:原理解析與SQL性能優化
- MySQL數據庫實用教程
- MySQL數據庫應用與管理
- SOLIDWORKS 2018中文版機械設計基礎與實例教程
- Arquillian Testing Guide
- 代碼的未來
- 產品經理數據修煉30問