Time for action – creating the Robot Rampage project
In Visual Studio Express, create a new XNA 4.0 Windows Game project called Robot Rampage.
Download the
0669_06_GRAPHICSPACK.zip
file from the book's website and extract the graphics resources to a temporary folder.In the Robot Rampage Content project, create a new folder called
Fonts
.Add a new SpriteFont called Pericles14 to the
Fonts
folder, updating the generated XML file to change theFontName
toPericles
.Also in the Content project, create a new folder called
Textures
.Add the graphics resources from the temporary directory to the
Textures
folder.In the
Initialize()
method of the Game1 class, add these lines to specify the size of the game window:this.graphics.PreferredBackBufferWidth = 800; this.graphics.PreferredBackBufferHeight = 600; this.graphics.ApplyChanges();
In the declarations area of the Game1 class, add a declaration for the sprite sheet and font objects:
Texture2D spriteSheet; Texture2D titleScreen; SpriteFont pericles14;
In...