Time for action – structuring the game
In the
EnemyManager
class, change the default value of theActive
member fromTrue
toFalse
:Public Active As Boolean = False
In the
Game1.vb
file, modify the declaration for thegameState
variable to set the default toGameStates.TitleScreen
:Private gameState As GameStates = GameStates.TitleScreen
Right-click on the Fonts folder in the content project, and select Add | New Item... Create a new
SpriteFont
object namedPericles14.spritefont
.The XML file for the
SpriteFont
will open automatically. Change the<FontName>
tag fromSegoe UI Mono
toPericles
.Add the following declarations to the
Game1
class:Public pericles14 As SpriteFont Private playerDeathDelayTime As Single = 10 Private playerDeathTimer As Single = 0 Private titleScreenTimer As Single = 0 Private titleScreenDelayTime As Single = 1 Private playerStartingLives As Integer = 3 Private playerStartLocation As Vector2 = New Vector2(390, 550) Private scoreLocation As Vector2 = New Vector2...