0 votes
628 views
asked in Cocos2D by (8.2k points)
Hi

  ParticleExplosion effets in cocos2d?

1 Answer

0 votes
answered by (3.1k points)

Hi

  for(int i = 0; i < 20; i++){

        CCParticleExplosion *exp = [[CCParticleExplosion alloc] initWithTotalParticles:100];

        float x = [self getRandomNumberBetween:0 to:self.contentSize.width];

        float y = [self getRandomNumberBetween:0 to:self.contentSize.height];

        exp.position = ccp(x,y);

        [exp setTexture:[CCTexture textureWithFile:@"numberHolder.png"]];

        exp.startColor = [CCColor colorWithRed:1.0f green:1.0f blue:0.0f];

        exp.endColor = [CCColor colorWithRed:1.0f green:1.0f blue:0.0f];

        exp.life = 1.0f;

        [self addChild:exp];

    }

Categories

...