protected virtual void InitializeSmokeExplosionParticle(Particle p, Vector2 where) { int minInitialSpeed = 20; int maxInitialSpeed = 30; int minAcceleration = -10; int maxAcceleration = -50; float minLifetime = 0.7f; float maxLifetime = 1.0f; float minScale = 0.1f; float maxScale = 0.3f; float minRotationSpeed = 0; float maxRotationSpeed = 0; // spriteBlendMode = SpriteBlendMode.AlphaBlend; //DrawOrder = AlphaBlendDrawOrder; Vector2 direction = PickRandomDirection(); float velocity = RandomBetween(minInitialSpeed, maxInitialSpeed); float acceleration = RandomBetween(minAcceleration, maxAcceleration); float lifetime = RandomBetween(minLifetime, maxLifetime); float scale = RandomBetween(minScale, maxScale); float rotationSpeed = RandomBetween(minRotationSpeed, maxRotationSpeed); p.Initialize(where, velocity * direction, acceleration * direction, lifetime, scale, rotationSpeed); }
protected virtual void InitializeSmokePlumeParticle(Particle p, Vector2 where) { Vector2 direction = PickRandomDirection(); p._alive = true; float velocity = RandomBetween(20, 100); float acceleration = RandomBetween(0, 0); float lifetime = RandomBetween(5, 7); float scale = RandomBetween(.5f, 1); float rotationSpeed = RandomBetween(-MathHelper.PiOver4 / 2.0f, MathHelper.PiOver4 / 2.0f); p.Initialize(where, velocity * direction, acceleration * direction, lifetime, scale, rotationSpeed); }
protected virtual void InitializeLightningParticle(Particle p, Vector2 where) { //protected override void InitializeConstants() //{ int minInitialSpeed = 100; int maxInitialSpeed = 200; int minAcceleration = 0; int maxAcceleration = 0; float minLifetime = 0.2f; float maxLifetime = .4f; float minScale = 0.1f; float maxScale = .2f; float minRotationSpeed = 0; float maxRotationSpeed = 3; //spriteBlendMode = SpriteBlendMode.Additive; //DrawOrder = AdditiveDrawOrder; Vector2 direction = PickRandomDirection(); float velocity = RandomBetween(minInitialSpeed, maxInitialSpeed); float acceleration = RandomBetween(minAcceleration, maxAcceleration); float lifetime = RandomBetween(minLifetime, maxLifetime); float scale = RandomBetween(minScale, maxScale); float rotationSpeed = RandomBetween(minRotationSpeed, maxRotationSpeed); p.Initialize(where, velocity * direction, acceleration * direction, lifetime, scale, rotationSpeed); p.rotation = (float)Math.PI; }