using cocos2d-x for android. can figure out why I can get this to go forward.
Been tring to follow the code for plist, but are still having an issue.
Im getting an error where the X’s are:
the addChild(spritesheet); CCSpritesheet is undefined for the type
CCSpriteFrame frame = CCSpriteFrameCache.spriteFrameByName(“bear” + i + “.png”); spriteframebyname is undefined for CCSpriteFramecache
Full code below
CGSize s = CCDirector.sharedDirector().winSize();
CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFrames(“AnimBear.plist”);
CCSprite sprite = CCSprite.sprite(“bear1.png”, true);
sprite.setPosition(s.width/2, s.height/2);
CCSpriteSheet spritesheet = CCSpriteSheet.spriteSheet(“AnimBear.png”);
spritesheet.addChild(sprite);
X addChild(spritesheet);
ArrayList animFrames = new ArrayList();
CCSpriteFrameCache.sharedSpriteFrameCache();
for(int i = 1; i <= 8; i++){
X CCSpriteFrame frame = CCSpriteFrameCache.spriteFrameByName(“bear” + i + “.png”);
animFrames.add(frame);
}
CCAnimation animation = CCAnimation.animation(“Bear”, 0.2f, animFrames);
CCAction action = CCRepeatForever.action(CCAnimate.action(animation, false));
sprite.runAction(action);
What are we doing wrong? Thanks for any advice…