Time for action – the EffectsManager class
Add a new class called EffectsManager to the Robot Rampage project.
Add the following
using
directives to the class file:using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics;
Modify the declaration of the EffectsManager class to make it static:
static class EffectsManager
Add declarations to the EffectsManager class:
#region Declarations static public List<Particle> Effects = new List<Particle>(); static Random rand = new Random(); static public Texture2D Texture; static public Rectangle ParticleFrame = new Rectangle(0, 288, 2, 2); static public List<Rectangle> ExplosionFrames = new List<Rectangle>(); #endregion
Add an
Initialize()
method to the EffectsManager class:#region Initialization public static void Initialize( Texture2D texture, Rectangle particleFrame, Rectangle explosionFrame, int explosionFrameCount) { Texture = texture; ParticleFrame = particleFrame; ExplosionFrames...