Skip to content

Instantly share code, notes, and snippets.

@yasith
Created August 27, 2012 15:38
Show Gist options
  • Save yasith/3489609 to your computer and use it in GitHub Desktop.
Save yasith/3489609 to your computer and use it in GitHub Desktop.
Cocos2d-x Particle
if(mEarnedPointAccumulator > blastPoint)
{
// Create the particle
cocos2d::CCParticleSystemQuad *pEmitter = CCParticleSystemQuad::particleWithFile("ScoreNumber.plist");
cocos2d::CCPoint particlePosition = getScoreLabel()->getPosition();
float width = (float)getScoreLabel()->getContentSizeInPixels().width * 0.575f;
// Starting position of the numbers (first digit)
pEmitter->setPosition( ccp(particlePosition.x - width , particlePosition.y));
this->addChild(pEmitter);
pointDelta = blastPoint * 0.95f; // The points grow exponentially
blastPoint *= blastExp; // There's a blastPoint (Particle) at powers of 10.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment