Time for action – structuring the game
In the EnemyManager class, change the default value of the
Active
member fromtrue
tofalse
:public bool Active = false;
In the
Game1.cs
file, modify the declaration for thegameState
variable to set the default toGameStates.TitleScreen
:GameStates gameState = GameStates.TitleScreen;
Right-click on the
Fonts
folder in the content project and select Add | New Item... Create a newSpriteFont
object namedPericles14.spritefont
.The XML file for the
SpriteFont
will open automatically. Change the<FontName>
tag fromKooteny
toPericles
.Add the following declarations to the Game1 class:
SpriteFont pericles14; private float playerDeathDelayTime = 10f; private float playerDeathTimer = 0f; private float titleScreenTimer = 0f; private float titleScreenDelayTime = 1f; private int playerStartingLives = 3; private Vector2 playerStartLocation = new Vector2(390, 550); private Vector2 scoreLocation = new Vector2(20, 10); private Vector2 livesLocation = new Vector2...