public void MultiActivateExplosion(Vector2 loc, int howMany) { for (int i = 0; i < howMany; i++) { Particle p = getParticle(); if (p != null) { float r = Global.randFloat(0.05f, 12.0f); float theta = Global.randAngle(); p.location = loc; p.velocity.X = r * (float)Math.Cos(theta); p.velocity.Y = r * (float)Math.Sin(theta); p.changeState(Particle.STATE_ACTIVE); } else { break; } } }
public override void Setup() { state = STATE_FLYING; location.X = Global.randFloat() * Global.windowWidth; location.Y = Global.randFloat() * Global.windowHeight; velocity.X = Global.randFloat(-0.05f, 0.05f); velocity.Y = Global.randFloat(-0.05f, 0.05f); rotation = Global.randAngle(); angularVelocity = Global.randFloat(-0.0003f, 0.0003f); layer = .02f; scale = 2.5f; friction = 1.0f; image = Global.bluePlanetImage; base.Setup(); //color.A = 140; }