植物大战僵尸的植物摇摆效果

 //帧动画
Animation *animation = Animation::create(); Sprite *sprite = Sprite::create("1.png");
sprite->setPosition(Vec2(, ));
this->addChild(sprite); for(int i=; i<; i++)
{
__String *string = __String::createWithFormat("%d.png",i);
SpriteFrame *sf = SpriteFrame::create(string->getCString(), Rect(, , , ));
animation->addSpriteFrame(sf);
} animation->setDelayPerUnit(0.2);
animation->setLoops(-); Animate *animate = Animate::create(animation);
sprite->runAction(animate);
05-08 08:30