我是初学者…下载了最新的那个cocos2dx来学习…
然后网上大多数教程都是2.0之前的…
所以现在貌似网上的代码都用不了…所以特来此请救!
CCArray *arrayFrames = new CCArray(4);
CCSpriteFrame *frame1 = cache->spriteFrameByName("girl1.png");
CCAnimationFrame *animationFrame1 = new CCAnimationFrame();
animationFrame1->setSpriteFrame(frame1);
arrayFrames->addObject(animationFrame1);
animationFrame1->release();
CCSpriteFrame *frame2 = cache->spriteFrameByName("girl2.png");
CCAnimationFrame *animationFrame2 = new CCAnimationFrame();
animationFrame2->setSpriteFrame(frame2);
arrayFrames->addObject(animationFrame2);
animationFrame2->release();
CCSpriteFrame *frame3 = cache->spriteFrameByName("girl3.png");
CCAnimationFrame *animationFrame3 = new CCAnimationFrame();
animationFrame3->setSpriteFrame(frame3);
arrayFrames->addObject(animationFrame3);
animationFrame3->release();
CCSpriteFrame *frame4 = cache->spriteFrameByName("girl4.png");
CCAnimationFrame *animationFrame4 = new CCAnimationFrame();
animationFrame4->setSpriteFrame(frame4);
arrayFrames->addObject(animationFrame4);
animationFrame4->release();
CCAnimation *animation = CCAnimation::create(arrayFrames, 1,2);
CCSprite *sprite = CCSprite::createWithSpriteFrameName("girl2.png");
sprite->setPosition(ccp(size.width*0.4, size.height*0.4));
spriteBatch->addChild(sprite);
sprite->runAction(CCAnimate::create(animation));
请问有没有人能解答一下…为什么我运行不起来