2370 auto s = Director::getInstance()->getWinSize();
2372 auto texture = Director::getInstance()->getTextureCache()->addImage(
"animations/dragon_animation.png");
2375 auto frame0 = SpriteFrame::createWithTexture(texture, Rect(132*0, 132*0, 132, 132));
2376 auto frame1 = SpriteFrame::createWithTexture(texture, Rect(132*1, 132*0, 132, 132));
2377 auto frame2 = SpriteFrame::createWithTexture(texture, Rect(132*2, 132*0, 132, 132));
2378 auto frame3 = SpriteFrame::createWithTexture(texture, Rect(132*3, 132*0, 132, 132));
2379 auto frame4 = SpriteFrame::createWithTexture(texture, Rect(132*0, 132*1, 132, 132));
2380 auto frame5 = SpriteFrame::createWithTexture(texture, Rect(132*1, 132*1, 132, 132));
2386 auto sprite = Sprite::createWithSpriteFrame(frame0);
2387 sprite->setPosition( Vec2( s.width/2-80, s.height/2) );
2390 Vector<SpriteFrame*> animFrames(6);
2391 animFrames.pushBack(frame0);
2392 animFrames.pushBack(frame1);
2393 animFrames.pushBack(frame2);
2394 animFrames.pushBack(frame3);
2395 animFrames.pushBack(frame4);
2396 animFrames.pushBack(frame5);
2398 auto animation = Animation::createWithSpriteFrames(animFrames, 0.2f);
2399 auto animate = Animate::create(animation);
2400 auto seq = Sequence::create(animate,
2401 FlipX::create(
true),
2403 FlipX::create(
false),
2406 sprite->runAction(RepeatForever::create( seq ) );