O'Reilly logo

XNA 4.0 Game Development by Example Beginner's Guide by Kurt Jaegers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required