Cocos2d 2.x 运动中的速度效果

CCSize size = CCDirector::sharedDirector()->getWinSize(); CCSprite * sp = CCSprite::create("guang.png"); sp->setPosition(ccp(sp->getContentSize().width / 2,size.height/2)); addChild(sp); //1.指数缓冲 //1.1 CCEaseExponentialIn //CCEaseExponentialIn *exponentialIn = CCEaseExponentialIn::create(CCMoveto::create(3.0f,ccp(size.width - sp->getContentSize().width / 2,size.height / 2))); //sp->runAction(exponentialIn); //1.2 CCEaseExponentialInOut //CCEaseExponentialInOut *exponentialInOut = CCEaseExponentialInOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(exponentialInOut); //1.3 CCEaseExponentialOut //CCEaseExponentialOut *exponentialOut = CCEaseExponentialOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(exponentialOut); //2.Sine缓冲 //2.1 CCEaseSineIn //CCEaseSineIn *sineIn = CCEaseSineIn::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(sineIn); //2.2 CCEaseSineInOut //CCEaseSineInOut *sineInOut = CCEaseSineInOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(sineInOut); //2.3 CCEaseSineOut //CCEaseSineOut *sineOut = CCEaseSineOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(sineOut); //3.弹性缓冲 //static CCEaseElasticInOut* create(CCActionInterval *pAction,float fPeriod);//fPeriod是弧度的周期,认是0.3 //static CCEaseElasticInOut* create(CCActionInterval *pAction); //3.1 CCEaseElastic //CCEaseElastic *elastic = CCEaseElastic::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(elastic); //3.2 CCEaseElasticIn //CCEaseElasticIn *elasticIn = CCEaseElasticIn::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(elasticIn); //3.3 CCEaseElasticInOut //CCEaseElasticInOut *elasticInOut = CCEaseElasticInOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(elasticInOut); //3.4 CCEaseElasticOut //*** //CCEaseElasticOut *elasticOut = CCEaseElasticOut::create(CCMoveto::create(5.0f,size.height / 2))); //sp->runAction(elasticOut); //4.跳跃缓冲 //4.1 CCEaseBounce //CCEaseBounce *bounce = CCEaseBounce::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(bounce); //4.2 CCEaseBounceIn //CCEaseBounceIn *bounceIn = CCEaseBounceIn::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(bounceIn); //4.3 CCEaseBounceInOut //CCEaseBounceInOut *bounceInOut = CCEaseBounceInOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(bounceInOut); //4.4 CCEaseBounceOut //********** CCEaseBounceOut *bounceOut = CCEaseBounceOut::create(CCMoveto::create(3.0f,size.height / 2))); sp->runAction(bounceOut); //5.回震缓冲 //5.1 CCEaseBackIn //CCEaseBackIn *backIn = CCEaseBackIn::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(backIn); //5.2 CCEaseBackOut //CCEaseBackOut *backOut = CCEaseBackOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(backOut); //5.3 CCEaseBackInOut //CCEaseBackInOut *backInOut = CCEaseBackInOut::create(CCMoveto::create(3.0f,size.height / 2))); //sp->runAction(backInOut);

相关文章

    本文实践自 RayWenderlich、Ali Hafizji 的文章《...
Cocos-code-ide使用入门学习地点:杭州滨江邮箱:appdevzw@1...
第一次開始用手游引擎挺激动!!!进入正题。下载资源1:从C...
    Cocos2d-x是一款强大的基于OpenGLES的跨平台游戏开发...
1.  来源 QuickV3sample项目中的2048样例游戏,以及最近《...
   Cocos2d-x3.x已经支持使用CMake来进行构建了,这里尝试...