DarkTornado

Particle Data Example

Jun 5th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.98 KB | None | 0 0
  1. class ParticleData
  2.     {
  3.        
  4.         //public Color color = Color.White;
  5.         public Particle.Property size;
  6.         public Particle.Property rotation;
  7.         public Particle.Property speed;
  8.         public Particle.Property direction;
  9.         public Texture2D sprite;
  10.         public bool relativeRotation;
  11.         public bool randomWiggle = true;
  12.         public int lifeTime;
  13.         private Color[] _color;
  14.         public ParticleData(Color[] color, Particle.Property size, Particle.Property rotation,
  15.                             Particle.Property speed, Particle.Property direction, Texture2D sprite,
  16.                             bool relativeRotation, int lifeTime)
  17.         {
  18.             _color = color;
  19.             this.size = size;
  20.             this.rotation = rotation;
  21.             this.speed = speed;
  22.             this.direction = direction;
  23.             this.sprite = sprite;
  24.             this.relativeRotation = relativeRotation;
  25.             this.lifeTime = lifeTime;
  26.         }
  27.  
  28.         public ParticleData(Color[] color, Particle.Property size, Particle.Property rotation,
  29.                     Particle.Property speed, Particle.Property direction, Texture2D sprite,
  30.                     bool relativeRotation, int lifeTime, bool randomWiggle)
  31.         {
  32.             _color = color;
  33.             this.size = size;
  34.             this.rotation = rotation;
  35.             this.speed = speed;
  36.             this.direction = direction;
  37.             this.sprite = sprite;
  38.             this.relativeRotation = relativeRotation;
  39.             this.lifeTime = lifeTime;
  40.             this.randomWiggle = randomWiggle;
  41.         }
  42.  
  43.         public Particle CreateParticle(Vector2 position)
  44.         {
  45.             Particle particle = new Particle(position, speed, direction, size, rotation, lifeTime, randomWiggle);
  46.             particle.color = _color;
  47.             particle.relativeRotation = relativeRotation;
  48.             particle.sprite = sprite;
  49.             return particle;
  50.         }
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment