[cocos2d-x]-会动的精灵
小鸟一直在扑翅膀的代码块:
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。 auto sprite = Sprite::create();
Animation *animation = Animation::create();
animation->addSpriteFrameWithFileName("bird_blue_1.png");
animation->addSpriteFrameWithFileName("bird_blue_2.png");
animation->addSpriteFrameWithFileName("bird_blue_0.png");
animation->setLoops(-1);
animation->setDelayPerUnit(0.5/3.0);
animation->setRestoreOriginalFrame(true);
Animate *animate = Animate::create(animation);
sprite->runAction(RepeatForever::create(animate));
![[cocos2d-x]-会动的精灵 随笔 第1张 [cocos2d-x]-会动的精灵 随笔 第1张](https://www.liuyixiang.com/zb_users/theme/Lucky/style/image/grey.gif)

更多精彩