Example #1
0
 public Emitter(Vector2 position, int lifetime, AnimatedTexture texture, ParticleSystem particleSystem)
 {
     this.position = position;
     this.lifeTime = lifetime;
     this.texture = texture;
     this.particleSystem = particleSystem;
 }
Example #2
0
 public SmokeLineParticle(Vector2 position, Vector2 direction, int lifetime, float scale, AnimatedTexture at, ParticleSystem ps)
 {
     this.position = position;
     this.direction = direction;
     this.lifetime = lifetime;
     this.texture = at;
     this.ps = ps;
     this.scale = scale;
 }
Example #3
0
        /// <summary>
        /// ParticleSystem ps
        /// Creates an Explosion on the position "position"
        /// in the direction "direction"
        /// with the scatter "scatter"
        /// with the particlegraphics "graphics"
        /// create number of particles "number"
        /// </summary>
        /// <param name="?"></param>
        public static void createExplosion(ParticleSystem ps, Vector2 position, Vector2 direction, Vector2 scatter, int number)
        {
            Random rand = new Random();

            for (int i = 0; i < number; i++)
            {
                direction.X += rand.Next((int)-scatter.X, (int)scatter.X);
                direction.Y += rand.Next((int)-scatter.Y, (int)scatter.Y);
                ps.particleList.Add(new Particle(position, direction, 1f, 300, 0.8f, GraphicsUtil.getWreckage()));
            }
        }
Example #4
0
        public ExplosionEmitter(Vector2 position, int area, int lifeTime, float perFrame, float xdirection, AnimatedTexture texture ,ParticleSystem ps)
        {
            this.position = position;
            this.area = area;
            this.lifeTime = lifeTime;
            this.perFrame = perFrame;
            this.ps = ps;
            this.texture = texture;
            this.xDirection = xdirection;


            init();
        }
Example #5
0
 public FireEmitter(Vector2 position, int lifetime, AnimatedTexture texture, ParticleSystem particleSystem, float xDirection)
     :base(position, lifetime, texture, particleSystem)
 {
     this.xDirection = xDirection;
 }
Example #6
0
 public ShockwaveEmitter(Vector2 position, int lifetime, AnimatedTexture texture, ParticleSystem particleSystem)
     :base(position, lifetime, texture, particleSystem)
 {
     this.left = position;
     this.right = position;
 }
Example #7
0
 public static void createDeadPerson(ParticleSystem ps, Vector2 pos, Vector2 dir, int i, float scale)
 {
     ps.particleList.Add(new Particle(pos, dir, 1f, 400, scale, GraphicsUtil.getPeopleDead(i), 0.03f));
 }
Example #8
0
 public static void createShockwave(ParticleSystem ps, Vector2 position)
 {
     ps.emitterList.Add(new ShockwaveEmitter(position, 60, GraphicsUtil.smoke, ps));
 }
Example #9
0
 public static void createExplosionWithSmoke(ParticleSystem ps, Vector2 position, int direction)
 {
     ps.emitterList.Add(new ExplosionEmitter(position, 8, 7, 0.7f, direction, GraphicsUtil.smoke, ps, 600, new Vector2(-1f, -0.1f)));
 }
Example #10
0
 public static void createExplosion(ParticleSystem ps)
 {
     ps.emitterList.Add(new ExplosionEmitter(new Vector2(300, 200), 1, 20, 1, 0, GraphicsUtil.explosion, ps));
 }