标签:style blog io ar color sp for on div
//给精灵创建帧动画 Animation* EnemyBase::createAnimation(std::string prefixName, int framesNum, float delay) { // 1 Vector<SpriteFrame*> animFrames; // 2 for (int i = 1; i <= framesNum; i++) { char buffer[20] = { 0 }; sprintf(buffer, "_%i.png", i); std::string str = prefixName + buffer; auto frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(str); animFrames.pushBack(frame); } // 3 return Animation::createWithSpriteFrames(animFrames, delay); }
每一个敌人精灵都带有一个帧动画
标签:style blog io ar color sp for on div
原文地址:http://www.cnblogs.com/newlist/p/4126426.html