0

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];   
mm24
  • 9,280
  • 12
  • 75
  • 170
  • hii......Try this may be it helps you... CCParticleSystem* system; system = [CCParticleFlower node]; [self addChild:system z:1 tag:1]; – Wolverine Aug 04 '12 at 05:02
  • @femina thanks, but unfortunately doesn't work. I am wondering if it has something to do with the fact that I have v2.0 + ARC enabled.. – mm24 Aug 04 '12 at 07:48

1 Answers1

1
  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.
Andres C
  • 919
  • 7
  • 14
  • Thanks a lot, it did work by adding the texture. I thought that was not needed for those effects as in the tutorial I had found was not super clear, but I know understand better. – mm24 Aug 04 '12 at 09:55