我的动画无效。它向我展示了我在初始化目标精灵时提到的框架。任何人都可以告诉我,我到底错过了什么?谢谢。
SpriteFrameCache *spriteCache = SpriteFrameCache::getInstance();
spriteCache->addSpriteFramesWithFile("explode.plist", "explosion_rollv2.png");
Vector<SpriteFrame*> frames(22);
for (int i; i<= 22; i++)
{
CCString *frame_name = CCString::createWithFormat("%d.png",i);
auto frame = spriteCache->getSpriteFrameByName(frame_name->getCString());
//frames->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(frame->getCString()));
frames.pushBack(frame);
}
auto blast_frame = Animation::createWithSpriteFrames(frames,0.1);
blast_frame->setRestoreOriginalFrame(true);
auto blast = Sprite::createWithSpriteFrameName("0.png");
blast->setPosition(Vec2(visibleSize.width/2,visibleSize.height/2));
this->addChild(blast,500);
blast->runAction(RepeatForever::create(Animate::create(blast_frame)));