Time for action – creating the EnemyManager class
Add a new class to the AsteroidBeltAssault project called EnemyManager.
Add the standard
using
directives to the top of the file:using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics;
Add declarations to the EnemyManager class:
private Texture2D texture; private Rectangle initialFrame; private int frameCount; public List<Enemy> Enemies = new List<Enemy>(); public ShotManager EnemyShotManager; private PlayerManager playerManager; public int MinShipsPerWave = 5; public int MaxShipsPerWave = 8; private float nextWaveTimer = 0.0f; private float nextWaveMinTimer = 8.0f; private float shipSpawnTimer = 0.0f; private float shipSpawnWaitTime = 0.5f; private float shipShotChance = 0.2f; private List<List<Vector2>> pathWaypoints = new List<List<Vector2>>(); private Dictionary<int, int> waveSpawns = new Dictionary<int, int>();public bool Active = true; private Random rand = new...