0

我遇到了一个问题,即 CCParticleExplosion 在模拟器上完美运行,而在我的 iPhone 4S 上却失败了。在模拟器中,粒子看起来很好。当我的 iPhone 上发生爆炸时,会出现爆炸的暗影和破碎的、闪烁的纹理碎片。这是我的代码:

bombExplosion = [[CCParticleExplosion alloc] initWithTotalParticles:3];
//bombExplosion = [[CCParticleExplosion alloc] init];

//bombExplosion.autoRemoveOnFinish = YES;
bombExplosion.texture = [[CCTextureCache sharedTextureCache] addImage: @"newnhamm_MultiColored_Sparkle_edit.png"];
bombExplosion.speed=100;
bombExplosion.duration = 1.3;
bombExplosion.life = 0.3;
bombExplosion.position = ccp(835,85);

ccColor4F startColor, startColorVar, endColor, endColorVar;
startColor.r = 1.0f;
startColor.g = 1.0f;
startColor.b = 1.0f;
startColor.a = 1.0f;

startColorVar.r = 0.0f;
startColorVar.g = 0.0f;
startColorVar.b = 0.0f;
startColorVar.a = 0.0f;

endColor.r = 1.0f;
endColor.g = 1.0f;
endColor.b = 1.0f;
endColor.a = 1.0f;

endColorVar.r = 0.0f;
endColorVar.g = 0.0f;
endColorVar.b = 0.0f;
endColorVar.a = 0.0f;

bombExplosion.startColor = startColor;
bombExplosion.startColorVar = startColorVar;
bombExplosion.endColor = endColor;
bombExplosion.endColorVar = endColorVar;

[self addChild:bombExplosion];
4

0 回答 0