Time for action – creating the EnemyManager class

  1. Add a new class to the AsteroidBeltAssault project called EnemyManager.
  2. Add the standard using directives to the top of the file:
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
  3. 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 ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.