newlist

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
CCParticleSystem* particleSystemFree = CCParticleSun::create();
        //设置贴图
        particleSystemFree->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
        //设置自动释放 
        particleSystemFree->setAutoRemoveOnFinish(true);
        //设置类型移动类型kCCPositionTypeFree-----随着layer的移动会有拖尾的效果
        particleSystemFree->setPositionType(kCCPositionTypeFree);
        particleSystemFree->setPosition(ccp(90,160));
        addChild(particleSystemFree);

        CCParticleSystem* particleSystemRe1 = CCParticleSun::create();
        particleSystemRe1->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
        //设置移动类型kCCPositionTypeRelative----随着layer的移动并没有什么变化
        particleSystemRe1->setPositionType(kCCPositionTypeRelative);
        particleSystemRe1->setPosition(ccp(200,160));
        addChild(particleSystemRe1);

        //让当前layer来回移动,观察两个移动模式不同的粒子特效
        CCFiniteTimeAction* move = CCMoveBy::create(3,ccp(290,0));
        CCFiniteTimeAction* back = move->reverse();
        this->runAction(CCSequence::create(move,back,NULL));

posted on 2013-06-07 17:09  一枚程序  阅读(1853)  评论(0编辑  收藏  举报