Hi,
Is there any sample for creating an animation sprite with pList?
I found some things but I can’t make it work.
CCSpriteFrameCache::sharedSpriteFrameCache()~~>addSpriteFramesWithFile;
CCAnimation *animation = CCAnimation::animation;
animation~~>setDelay(0.2f);
char frameName[4];
for (int i=1; i<=4; i++) {
sprintf(frameName, “PartBox_%d.png”, i);
CCSpriteFrame* pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()>spriteFrameByName;>addFrame(pFrame); // <——— here it gives an exception reading location don’t know why =/
animation
}
CCAnimate *anim = CCAnimate::actionWithAnimation(animation,true);
sprite~~>runAction;
spriteAnim~~>setPosition(ccp(200,200));
Is this wrong or is this correct?
And
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(“Parts/Part1.plist”);
This I only have to call once like at the beginning of loading the scene?
Sorry first time using cocos2d.
friendly regards.