Note that there are some explanatory texts on larger screens.

plurals
  1. POCocos2D Particle bugged on Device
    text
    copied!<p>my particles are working fine in the simulator, but when I run the app with the device (iPhone 4S - iOS 6.1) it looks like some weird lasers (see the images below):</p> <p>Particles on the Device: <a href="https://dl.dropboxusercontent.com/u/58621241/IMG_2287.PNG" rel="nofollow">https://dl.dropboxusercontent.com/u/58621241/IMG_2287.PNG</a></p> <p>Particles on Simulator: <a href="https://dl.dropboxusercontent.com/u/58621241/Screen%20Shot%202013-06-20%20at%2018.10.15.png" rel="nofollow">https://dl.dropboxusercontent.com/u/58621241/Screen%20Shot%202013-06-20%20at%2018.10.15.png</a></p> <p>And here is the code where I create the particlesystem:</p> <pre><code>@implementation CCParticleMainDrill -(id) init { return [self initWithTotalParticles:100]; } -(id) initWithTotalParticles:(NSUInteger) p { if( (self=[super initWithTotalParticles:p]) ) { // _duration _duration = kCCParticleDurationInfinity; // Gravity Mode self.emitterMode = kCCParticleModeGravity; // Gravity Mode: gravity self.gravity = ccp(0,100); // Gravity Mode: speed of particles self.speed = 400; self.speedVar = 230; // Gravity Mode: radial self.radialAccel = 0; self.radialAccelVar = 0; // Gravity Mode: tagential self.tangentialAccel = 0; self.tangentialAccelVar = 0; ccBlendFunc ccbf = {GL_DST_COLOR,GL_DST_ALPHA};//{GL_SRC_ALPHA,GL_SRC_ALPHA_SATURATE}; self.blendFunc = ccbf; // _angle _angle = 90; _angleVar = 60; // emitter position //CGSize winSize = [[CCDirector sharedDirector] winSize]; self.positionType = kCCPositionTypeFree; self.position = ccp(0, 0);// ccp(winSize.width/2, winSize.height/2); self.posVar = ccp(3, 0); // _life of particles _life = 0.06; _lifeVar = 0.1; // size, in pixels _startSize = 5.0f; _startSizeVar = 1.0f; _endSize = 3.0f; _endSizeVar = 0.00f; // emits per second _emissionRate = _totalParticles/_life; // color of particles _startColor.r = 0.25f; _startColor.g = 0.14f; _startColor.b = 0.07f; _startColor.a = 1.0f; _startColorVar.r = 0.0f; _startColorVar.g = 0.0f; _startColorVar.b = 0.0f; _startColorVar.a = 0.0f; _endColor.r = 0.28f; _endColor.g = 0.19f; _endColor.b = 0.12f; _endColor.a = 0.30f; _endColorVar.r = 0.0f; _endColorVar.g = 0.0f; _endColorVar.b = 0.0f; _endColorVar.a = 0.0f; self.texture = [[CCTextureCache sharedTextureCache] addImage: @"particle.png"]; // additive self.blendAdditive = YES; } return self; } @end </code></pre> <p>And this one when I add the Particles to the scene:</p> <pre><code>Armor = [CCSprite spriteWithFile:@"player.png"]; Armor.position = ccp(16, 16); [self addChild:Armor]; DrillParticles = [CCParticleMainDrill node];//[CCParticleSmoke node]; [DrillParticles setPosition:ccp(Armor.boundingBox.size.width/2, 0)]; [DrillParticles setTotalParticles:0]; [Armor addChild:DrillParticles z:INT_MAX]; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload