Time for action – updating and drawing the EnemyManager
Add the
Update()
method to the EnemyManager class:public void Update(GameTime gameTime) { EnemyShotManager.Update(gameTime); for (int x = Enemies.Count - 1; x >= 0; x--) { Enemies[x].Update(gameTime); if (Enemies[x].IsActive() == false) { Enemies.RemoveAt(x); } else { if ((float)rand.Next(0, 1000) / 10 <= shipShotChance) { Vector2 fireLoc = Enemies[x].EnemySprite.Location; fireLoc += Enemies[x].gunOffset; Vector2 shotDirection = playerManager.playerSprite.Center - fireLoc; shotDirection.Normalize(); EnemyShotManager.FireShot( fireLoc, shotDirection, false); } } } if (Active) { updateWaveSpawns(gameTime); }...