我遇到一个问题,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];