Cocos2d v2.0: unable to add CCParticleSystem to scene

869 views Asked by At

I'm trying to add CCParticleFlower to my Cocos2d v2.0 (with ARC enabled) HelloWorld scene. That's the code I am running:

CCParticleFlower* system = [[CCParticleFlower alloc] initWithTotalParticles:10];
        // Set some parameters that can't be set in Particle Designer
//        system.positionType = kCCPositionTypeFree;
  //      system.autoRemoveOnFinish = YES;
         system.visible = TRUE;
         [system setDuration:4.0f];
         system.position = CGPointMake(150.0f, 100.0f);
         [self addChild:system z:0];   

I tried several variants but I'm not quiet sure what I am doing wrong as I never managed to run it.

E.g.:

CCParticleSystem * system = [CCParticleFlower node];
system.position = CGPointMake(150.0f, 100.0f);
[self addChild:system];   
1

There are 1 answers

1
Andres C On BEST ANSWER
  1. Make sure to include the texture that is used on the particle system in your project.
  2. Try resetting the system and see if it works. [system reset]. You could even try [system scheduleUpdate] just in case its not updating correclty.