I am seasoned in programming .net but new to c++ i have a very good understanding so far and i am trying to follow the spritesheet animation tutorial and it just doesnt work. below is the code used straight from the tutorial:
bool character::animate(){
SpriteBatchNode* spritebatch = SpriteBatchNode::create("animations/grossini.png");
SpriteFrameCache* cache = SpriteFrameCache::getInstance();
cache->addSpriteFramesWithFile("animations/grossini.plist");
Sprite* Sprite1 = Sprite::createWithSpriteFrameName("grossini_dance_01.png");
spritebatch->addChild(Sprite1);
addChild(spritebatch);
Vector<SpriteFrame*> animFrames(15);
char str[100] = { 0 };
for (int i = 1; i < 15; i++)
{
sprintf(str, "grossini_dance_%02d.png", i);
SpriteFrame* frame = cache->getSpriteFrameByName(str);
animFrames->addObject(frame);
}
Animation* animation = Animation::createWithSpriteFrames(animFrames, 0.3f);
Sprite1->runAction(RepeatForever::create(Animate::create(animation)));
}
Obviously i will change the filenames and sprites however i cant even get it to compile i get an "error C2819: type ‘cocos2d::Vector<cocos2d::SpriteFrame *>’ does not have an overloaded member ‘operator ->’ on this line “animFrames->addObject(frame);” and i dont understand why…I am sure this is a simple issue…something i overlooked maybe…but being so new to the whole language has me at a disadvantage. Thank you for any help or advice that can be given.