Time for action - beginning the WeaponManager class

  1. Add a new class called WeaponManager to the Robot Rampage project.
  2. Add the following using directives to the top of the WeaponManager class file:
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
  3. Modify the declaration of the WeaponManager class to make it a static class:
    static class WeaponManager
  4. Add declarations to the WeaponManager class:
    #region declarations
    static public List<Particle> Shots = new List<Particle>();
    static public Texture2D Texture;
    static public Rectangle shotRectangle =
    new Rectangle(0, 128, 32, 32);
    static public float WeaponSpeed = 600f;
    static private float shotTimer = 0f;
    static private float shotMinTimer = 0.15f;
  5. Add properties to the ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.