示例#1
0
        public ExplosionManager(Game game)
        {
            explosions         = new List <ParticleExplosion>();
            explosionSetting   = new ExplosionSetting();
            expParticleSetting = new ExplosionParticleSettings();

            //texture= game.Content.Load<Texture2D>("textures\\Particle");
            //effect = game.Content.Load<Effect>("Effect\\Explosion");
            //effect.CurrentTechnique = effect.Techniques["Textured"];
            //effect.Parameters["theTexture"].SetValue(texture);
        }
示例#2
0
        public ParticleExplosion(GraphicsDevice graphicsDevice, Vector3 position,
                                 int lifeLeft, int roundTime, int numParticlesPerRound, int maxParticles,
                                 Vector2 textureSize, ExplosionParticleSettings particleSettings, float maxRadius, float maxVelocity)
        {
            this.position             = position;
            this.graphicsDevice       = graphicsDevice;
            this.lifeLeft             = lifeLeft;
            this.numParticlesPerRound = numParticlesPerRound;
            this.maxParticles         = maxParticles;
            this.roundTime            = roundTime;
            this.textureSize          = textureSize;
            this.particleSettings     = particleSettings;
            this.maxRadius            = maxRadius;
            this.maxVelocity          = maxVelocity;

            vertexDeclaration = new VertexDeclaration(new VertexElement[] {});
            particles         = new ParticleExp[maxParticles];
            InitializeParticles();
        }