Time for action – the GoalManager class
Add a new class called GoalManager to the Robot Rampage project.
Add the following
using
directives to the top of the class file:using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics;
Modify the declaration of the GoalManager class to make it a static class:
static class GoalManager
Add declarations to the GoalManager class:
#region Declarations private static List<ComputerTerminal> computerTerminals = new List<ComputerTerminal>(); private static int activeCount = 0; private static int minDistanceFromPlayer = 250; private static Random rand = new Random(); private static Texture2D texture; private static Rectangle initialActiveFrame; private static Rectangle initialDisabledFrame; private static int activeFrameCount; private static int disabledFrameCount; #endregion
Add a read-only property to the GoalManager class:
#region Properties public static int ActiveTerminals { get { return activeCount; } } #endregion
Add the...