Time for action – updating and drawing the EnemyManager
Add the
Update()
method to theEnemyManager
class:Public Sub Update(gameTime As GameTime) EnemyShotManager.Update(gameTime) For x As Integer = Enemies.Count - 1 to 0 Step -1 Enemies(x).Update(gameTime) if Not Enemies(x).IsActive() Then Enemies.RemoveAt(x) Else If CSng(rand.Next(0, 1000)) / 10 <= shipShotChance Then Dim fireLoc As Vector2 = Enemies(x).EnemySprite.Location fireLoc += Enemies(x).gunOffset Dim shotDirection As Vector2 = _playerManager.playerSprite.Center - fireLoc EnemyShotManager.FireShot( fireLoc, shotDirection, False) End If End If Next If Active Then updateWaveSpawns(gameTime) End If End Sub
Add the
Draw()
method to theEnemyManager
class:Public Sub Draw(spriteBatch As SpriteBatch) EnemyShotManager.Draw...