Time for action – updating the Game1 class
Add the following declarations to the
Game1
class:Public Enum GameStates TitleScreen Playing WaveComplete GameOver End Enum Private gameState As GameStates = GameStates.TitleScreen Private gameOverTimer As Single = 0 Private gameOverDelay As Single = 6 Private waveCompleteTimer As Single = 0 Private waveCompleteDelay As Single = 6
Remove the call to
GoalManager.GenerateComputers()
from theLoadContent()
method of theGame1
class.Add the
checkPlayerDeath()
method to theGame1
class:Private Sub checkPlayerDeath() For Each enemyTank As Enemy In EnemyManager.Enemies If (enemyTank.EnemyBase.IsCircleColliding( Player.BaseSprite.WorldCenter, Player.BaseSprite.CollisionRadius)) Then gameState = GameStates.GameOver End If Next End Sub
Replace the existing
Update()
method of theGame1
class with the following code:Protected Overrides Sub Update(gameTime As GameTime) ' Allows...