public void createDust() { int initAge = 500; Vector2 initPos = mOrigin; Vector2 initVelo = new Vector2(((float)(50.0f * Math.Cos(mEffectDuration))), ((float)(50.0f * Math.Sin(mEffectDuration)))); Vector2 initAcc = new Vector2(0, 75); float initDamp = 1.0f; float initRot = 0.0f; float initRotVel = 1.0f; float initRotDamp = 0.99f; float initScale = 0.3f; float initScaleVelo = -0.01f; float initScaleAcc = 0.1f; float maxScale = 1.0f; Color initColor = new Color( (random.Next(0,255)), (random.Next(0,255)), (random.Next(0,255))); Color finalColor = new Color( (random.Next(0, 255)), (random.Next(0, 255)), (random.Next(0, 255))); finalColor.A = 0; int fadeAge = initAge; Particle tempParticle = new Particle(); tempParticle.create(particleTexture, initAge, initPos, initVelo, initAcc, initDamp, initRot, initRotVel, initRotDamp, initScale, initScaleVelo, initScaleAcc, maxScale, initColor, finalColor, fadeAge); mParticles.Add(tempParticle); }
public void createExplosion() { int initAge = 2000 + (int)random.Next(5000); mOriginRadius = 50; Vector2 initPos = mOrigin; Vector2 offset = Vector2.Zero; offset.X = ((float)(random.Next(mOriginRadius) * Math.Cos(random.Next(360)))); offset.Y = ((float)(random.Next(mOriginRadius) * Math.Sin(random.Next(360)))); initPos += offset; Vector2 initVelo = Vector2.Zero; initVelo.X = random.Next(500) + (offset.X * 30); initVelo.Y = random.Next(500) + (offset.X * 30); Vector2 initAcc = new Vector2(0, 400); float initDamp = 1.0f; float initRot = 0.0f; float initRotVel = initVelo.X / 50.0f; float initRotDamp = 0.99f; float initScale = 0.1f + ((float)random.Next(10)) / 50.0f; float initScaleVelo = ((float)random.Next(10)) / 50.0f; float initScaleAcc = 0.0f; float maxScale = 1.0f; Color initColor = new Color((random.Next(0, 255)), (random.Next(0, 255)), (random.Next(0, 255))); Color finalColor = new Color((random.Next(0, 255)), (random.Next(0, 255)), (random.Next(0, 255))); finalColor.A = 0; int fadeAge = initAge / 2; Particle tempParticle = new Particle(); tempParticle.create(particleTexture, initAge, initPos, initVelo, initAcc, initDamp, initRot, initRotVel, initRotDamp, initScale, initScaleVelo, initScaleAcc, maxScale, initColor, finalColor, fadeAge); mParticles.Add(tempParticle); }
public void createKnockback() { int initAge = 500; Vector2 initPos = mOrigin; mOriginRadius = 30; Vector2 offset = Vector2.Zero; offset.X = ((float)(random.Next(mOriginRadius) * Math.Cos(random.Next(360)))); offset.Y = ((float)(random.Next(mOriginRadius) * Math.Sin(random.Next(360)))); initPos += offset; Vector2 initVelo = Vector2.Zero; Vector2 initAcc = new Vector2(0, 75); float initDamp = 1.0f; float initRot = 0.0f; float initRotVel = 1.0f; float initRotDamp = 0.99f; float initScale = 0.1f; float initScaleVelo = -0.01f; float initScaleAcc = 0.1f; float maxScale = 1.0f; Color initColor = new Color((random.Next(0, 255)), (random.Next(0, 255)), (random.Next(0, 255))); Color finalColor = new Color((random.Next(0, 255)), (random.Next(0, 255)), (random.Next(0, 255))); finalColor.A = 0; int fadeAge = initAge; Particle tempParticle = new Particle(); tempParticle.create(particleTexture, initAge, initPos, initVelo, initAcc, initDamp, initRot, initRotVel, initRotDamp, initScale, initScaleVelo, initScaleAcc, maxScale, initColor, finalColor, fadeAge); mParticles.Add(tempParticle); }