auto spriteRun = Sprite::create("man/Run_0.png");
spriteRun->setPosition(Vec2(visibleSize.width / 2, visibleSize.height / 2));
this->addChild(spriteRun);
Vector<SpriteFrame*> vecSpriteFrame;
for (int i = 0; i < 5; ++i)
{
char spriteFrameName[20];
sprintf(spriteFrameName, "man/Run_%d.png", i);
auto spriteFrame = SpriteFrame::create(spriteFrameName,Rect(0, 0, spriteRun->getContentSize().width, spriteRun->getContentSize().height));
vecSpriteFrame.pushBack(spriteFrame);
}
auto animation = Animation::createWithSpriteFrames(vecSpriteFrame,0.2f);
auto animate = Animate::create(animation);
spriteRun->runAction(RepeatForever::create(animate));//使用RepeatForever可以让动作重复下去