Time for action – creating the EnemyManager class
Add a new class to the Asteroid Belt Assault project called
EnemyManager
.Add declarations to the
EnemyManager
class:Private _texture As Texture2D Private _initialFrame As Rectangle Private _frameCount As Integer Public Enemies As List(Of Enemy) = New List(Of Enemy)() Public EnemyShotManager As ShotManager Private _playerManager As PlayerManager Public MinShipsPerWave As Integer = 5 Public MaxShipsPerWave As Integer = 8 Private nextWaveTimer As Single = 0.0 Private nextWaveMinTimer As Single = 8.0 Private shipSpawnTimer As Single = 0.0 Private shipSpawnWaitTime As Single = 0.5 Private shipShotChance As Single = 0.2 Private pathWaypoints As List(Of List(Of Vector2)) = New List(Of List(Of Vector2))() Private waveSpawns As Dictionary(Of Integer, Integer) = New Dictionary(Of Integer, Integer)() Public Active As Boolean = True Private rand As Random = New Random()
What just happened?
As with our other manager classes, the EnemyManager...