O'Reilly logo

XNA 4.0 Game Development by Example Beginner's Guide by Kurt Jaegers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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;
    #endregion
    
  5. Add properties to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required