Created
August 27, 2012 15:38
-
-
Save yasith/3489609 to your computer and use it in GitHub Desktop.
Cocos2d-x Particle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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