cocos2d-x的animFrames数组使用错误,网上的一段代码示例
//创建cache
CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache();
char strPlist[64] = {0};
char strPng[64] = {0};
sprintf(strPlist,"fei.plist");
//sprintf(strPng,"fei.pvr.ccz");
sprintf(strPng,"fei.png");
cache->addSpriteFramesWithFile(strPlist, strPng);
//创建动画每一帧,从cache里面读取
CCMutableArray<CCSpriteFrame*>* animFrames = new CCMutableArray<CCSpriteFrame*>(6);
char str[64] = {0};
for(int i = 1; i <= 6; i++)
{
sprintf(str, "飞%04d.png", i);
CCSpriteFrame* frame = cache->spriteFrameByName( str );
animFrames->addObject(frame);
}
CCAnimation* animation = CCAnimation::animationWithFrames(animFrames,0.04f);
CCRepeatForever* mFly=CCRepeatForever::actionWithAction( CCAnimate::actionWithAnimation(animation, false));
animFrames->release();
cache->removeSpriteFramesFromFile(strPlist);
QUESTION:
1。VS2010文件夹都搜索了没找到“ccmutablearray.h”, “CCMutableArray”标识符未知
2。忘记C++里有这种复合类型声明了,编译错误“在<号前缺少;”这种声明叫什么啊,我还能用吗
3。于是我改成了CCArray *animFrames=CCArray::create();编译通过了
可是第二句如果不执行不出错也没显示,一执行就会出现“assertion failed!”“object!=0”错误,
我把animFrames赋初值0,结果执行又出现 异常中断 ,msvc10d.dll出错,好象是这个文件
有谁懂cocos2d-x的?帮帮忙啊,眼看着就要动起来了,就是执行不过去,到底哪里有错