if (nextSpawn < 0) {
nextSpawn = (int) spawnInterval.value();
int count = (int) spawnCount.value();
for (int i = 0; i < count; i++) {
Particle p = system.getNewParticle(this, initialLife.value());
p.setSize(initialSize.value());
p.setPosition(x + xOffset.value(), y + yOffset.value());
p.setVelocity(0, 0, 0);
float dist = initialDistance.value();
float power = speed.value();
if ((dist != 0) || (power != 0)) {
float s = spread.value();
float ang = (s + angularOffset.value() - (spread.value() / 2)) - 90;
float xa = (float) FastTrig.cos(Math.toRadians(ang)) * dist;
float ya = (float) FastTrig.sin(Math.toRadians(ang)) * dist;
p.adjustPosition(xa, ya);
float xv = (float) FastTrig.cos(Math.toRadians(ang));
float yv = (float) FastTrig.sin(Math.toRadians(ang));
p.setVelocity(xv, yv, power * 0.001f);
}
if (image != null) {
p.setImage(image);
}
ColorRecord start = (ColorRecord) colors.get(0);
p.setColor(start.col.r, start.col.g, start.col.b, startAlpha.value() / 255.0f);
p.setUsePoint(usePoints);
p.setOriented(useOriented);
if (emitCount.value() != -1) {
leftToEmit--;
if (leftToEmit <= 0) {
break;