Time for action – structuring the game

  1. In the EnemyManager class, change the default value of the Active member from true to false:
    public bool Active = false;
  2. In the Game1.cs file, modify the declaration for the gameState variable to set the default to GameStates.TitleScreen:
    GameStates gameState = GameStates.TitleScreen;
  3. Right-click on the Fonts folder in the content project and select Add | New Item... Create a new SpriteFont object named Pericles14.spritefont.
  4. The XML file for the SpriteFont will open automatically. Change the <FontName> tag from Kooteny to Pericles.
  5. Add the following declarations to the Game1 class:
    SpriteFont pericles14; private float playerDeathDelayTime = 10f; private float playerDeathTimer = 0f; private float titleScreenTimer ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.