I am trying to make the fireworks particle effect all white or offwhite (kinda the rain particle color) instead of multicolored but i cannot seem to do it
this is the code i am trying with no success
there is obviously some other code in here but this is my whole function i call. the color is different but just seems to be a little off from the original colors, nothing near my goal.
+(void) createExplosionSpaceX: (float) x y: (float) y inParent: (CCNode*) parentNode
{
CGSize winSize = [[CCDirector sharedDirector] winSize];
CCParticleSystem *emitter;
emitter = [[CCParticleFireworks alloc] init];
emitter.texture = [[CCTextureCache sharedTextureCache] addImage:@"stars.png"];
y = -30;
int i = 1;
while (true)
{
if (x < (winSize.width+15/2)/5*i) {
x = (winSize.width+15/2)/5*i-((winSize.width+15/2)/5/2);
break;
}
i++;
}
// color of particles
emitter.startColor.r = 1.0f;
emitter.startColor.g = 1.0f;
emitter.startColor.b = 1.0f;
emitter.startColor.a = 1.0f;
emitter.startColorVar.r = 0.0f;
emitter.startColorVar.g = 0.0f;
emitter.startColorVar.b = 0.0f;
emitter.startColorVar.a = 0.0f;
emitter.endColor.r = 1.0f;
emitter.endColor.g = 1.0f;
emitter.endColor.b = 1.0f;
emitter.endColor.a = 0.0f;
emitter.endColorVar.r = 0.0f;
emitter.endColorVar.g = 0.0f;
emitter.endColorVar.b = 0.0f;
emitter.endColorVar.a = 0.0f;
// gravity
emitter.gravity.x = 0;
emitter.gravity.y = -90;
// angle
emitter.angle = 90;
emitter.angleVar = 20;
// radial
emitter.radialAccel = 0;
emitter.radialAccelVar = 0;
// speed of particles
emitter.speed = 180;
emitter.speedVar = 50;
// life of particles
emitter.life = 3.5f;
emitter.lifeVar = 1;
// emits per frame
emitter.emissionRate = emitter.totalParticles/emitter.life;
// size, in pixels
emitter.startSize = 8.0f;
emitter.startSizeVar = 2.0f;
emitter.endSize = kParticleStartSizeEqualToEndSize;
// additive
emitter.blendAdditive = NO;
//NSLog([NSString stringWithFormat:@"y: %f", y]);
emitter.position = ccp(x,y);
emitter.duration = 3;
emitter.autoRemoveOnFinish = YES; // this removes/deallocs the emitter after its animation
[parentNode addChild:emitter];
}
