8,304
社区成员
发帖
与我相关
我的任务
分享
void LoadingScene::toRight(float dt)
{
CCAnimation *animation = CCAnimation::create();
for (int i = 0; i < 4; i++)
{
CCSpriteFrame *frame = CCSpriteFrame::create("role.png",
CCRectMake(32 * i, 96, 32, 48));
animation->addSpriteFrame(frame);
}
CCSpriteFrame *endFrame = CCSpriteFrame::create("role.png",
CCRectMake(0, 96, 32, 48));
animation->addSpriteFrame(endFrame);
animation->setDelayPerUnit(0.08f);
CCAnimate *animate = CCAnimate::create(animation);
CCAction *move = CCMoveBy::create(0.5, ccp(5, 0));
//CCAction *spawn = CCSpawn::create(animate, move, NULL);
role->runAction(animate);
CCLog("toright...");
if (role->getPositionX() < 700)
{
//role->runAction(move);
}
else
{
//this->bgBack();
}
}