public DebrisParticleEmitter(int numParticles) { MaxParticleCount = numParticles; Particles = new List<RectangleParticle>(); Gravity = new Vector(0f, -.5f, 0f); ; MainTimer = new Timer(); MainTimer.Tick += AnimationStep; MainTimer.Interval = 10; Scale = 0.5f; ExplosionDuration = 100; StartingColor = Color.FromArgb(255, Color.Orange); EndColor = Color.FromArgb(255, Color.DarkGray); Particles = new List<RectangleParticle>(); for (int i = 0; i < MaxParticleCount; ++i) { //here we set the constant values of our particle var temp = new RectangleParticle(this); temp.Size.X = particleSize.X; temp.Size.Y = particleSize.Y; temp.AnimationTime = 10; temp.TargetColor = EndColor; temp.Texture = images[GeneralMath.RandomInt() % images.Length]; Particles.Add(temp); } }
public ExplosionParticleEmitter(int numParticles) { MaxParticleCount = numParticles; MainTimer = new Timer(); MainTimer.Tick += AnimationStep; MainTimer.Interval = 10; Scale = 0.5f; Gravity = new Vector(0.0f, 0.0f, 0.0f); ExplosionDuration = 70; FadeOutDuration = 500; StartingColor = Color.FromArgb(255, Color.Orange); EndColor = Color.FromArgb(128, Color.Red); SmokeColor = Color.FromArgb(0, Color.Black); Particles = new List<RectangleParticle>(); float z = 0.0f; for (int i = 0; i < MaxParticleCount; ++i) { //here we set the constant values of our particle var temp = new RectangleParticle(this); temp.AnimationTime = 10; temp.Location.Z = z; temp.Texture = defaultTexture; Particles.Add(temp); z += 0.1f; } }
public ParticleTrailEmitter(int numParticles, Color mainColor, int launchInterval) { MainColor = mainColor; LaunchInterval = launchInterval; MaxParticleCount = numParticles; MainTimer = new Timer(); MainTimer.Tick += AnimationStep; MainTimer.Interval = 10; Scale = 1f; Gravity = new Vector(0.0f, 0.005f, 0.0f); FadeOutDuration = 1000; Particles = new List<RectangleParticle>(); float z = 0.0f; for (int i = 0; i < MaxParticleCount; ++i) { //here we set the constant values of our particle var temp = new RectangleParticle(this); temp.AnimationTime = 10; temp.Location.Z = z; temp.Texture = defaultTexture; Particles.Add(temp); z += 0.1f; } }