Exemplo n.º 1
0
CCParticleSystemQuad * CCParticleSystemQuad::create() {
    CCParticleSystemQuad *pParticleSystemQuad = new CCParticleSystemQuad();
    if (pParticleSystemQuad && pParticleSystemQuad->init())
    {
        pParticleSystemQuad->autorelease();
        return pParticleSystemQuad;
    }
    CC_SAFE_DELETE(pParticleSystemQuad);
    return NULL;
}
Exemplo n.º 2
0
CCParticleSystemQuad * CCParticleSystemQuad::createWithTotalParticles(unsigned int numberOfParticles) {
    CCParticleSystemQuad *pRet = new CCParticleSystemQuad();
    if (pRet && pRet->initWithTotalParticles(numberOfParticles))
    {
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return pRet;
}
Exemplo n.º 3
0
CCParticleSystemQuad * CCParticleSystemQuad::create(const char *plistFile)
{
    CCParticleSystemQuad *pRet = new CCParticleSystemQuad();
    if (pRet && pRet->initWithFile(plistFile))
    {
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return pRet;
}
Exemplo n.º 4
0
void BlockManager::Particle(CGPoint _pos)
{
    CCParticleSystemQuad* particle;
    particle = new CCParticleSystemQuad;
    particle->initWithTotalParticles(600);
    particle->autorelease();

    CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage("Tile/Tile_Ground_2.png");

    particle->setTexture(texture);
    particle->setEmissionRate(296.43);
    particle->setAngle(90.0);
    particle->setAngleVar(36.2);
    ccBlendFunc blendFunc= {GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA};
    particle->setBlendFunc(blendFunc);
    particle->setDuration(0.10);
    particle->setEmitterMode(kCCParticleModeGravity);

    ccColor4F startColor= {1.00,1.00,1.00,1.00};
    particle->setStartColor(startColor);

    ccColor4F startColorVar= {0.00,0.00,0.00,0.00};
    particle->setStartColorVar(startColorVar);

    ccColor4F endColor= {1.00,1.00,1.00,0.55};
    particle->setEndColor(endColor);

    ccColor4F endColorVar= {0.00,0.00,0.00,0.00};
    particle->setEndColorVar(endColorVar);

    particle->setStartSize(6.03);
    particle->setStartSizeVar(0.00);
    particle->setEndSize(-1.00);
    particle->setEndSizeVar(0.00);
    particle->setGravity(ccp(0.00, -1837.19));
    particle->setRadialAccel(0.00);
    particle->setRadialAccelVar(0.00);
    particle->setSpeed(234);
    particle->setSpeedVar(300);
    particle->setTangentialAccel(0);
    particle->setTangentialAccelVar(0);
    particle->setTotalParticles(501);
    particle->setLife(1.69);
    particle->setLifeVar(0.10);
    particle->setStartSpin(0.00);
    particle->setEndSpin(0.00);
    particle->setEndSpinVar(0.00);
    particle->setPosition(_pos);
    particle->setPosVar(ccp(10.00,0.00));

    m_pGround->addChild(particle);

}