Time for action – the GameManager class

  1. Add a new class called GameManager to the Robot Rampage project.
  2. Add the following using directive to the top of the GameManager class:
    using Microsoft.Xna.Framework;
  3. Modify the declaration of the class to make it a static class:
    static class GameManager
  4. Add declarations to the GameManager class:
    #region Declarations
    public static int Score = 0;
    public static int CurrentWave = 0;
    public static int BaseTerminalCount = 8;
    public static int MaxTerminalCount = 15;
    public static int CurrentTerminalCount = 8;
    public static Vector2 PlayerStartLoc = new Vector2(32, 32);
    #endregion
  5. Add public methods to the GameManager class:
    #region Public Methods public static void StartNewWave() { CurrentWave++; if (CurrentTerminalCount ...

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.