当前位置:编程学习 > wap >>

无限重复动作-新手引导箭头上下移动

让箭头上下无限重复移动的方法:
 
 
 
CCSprite *arrow = CCSprite::createWithSpriteFrameName("ug_arrow");  
if (arrow)  
{  
    arrow->setAnchorPoint(info.arPoint);  
    arrow->setPosition(ccp(info.centerPos.x, info.centerPos.y+80));  
    this->addChild(arrow, 10);  
  
    // TODO:让箭头重复上下移动  
    CCMoveBy *move = CCMoveBy::create(0.3f, ccp(0, 10));  
    arrow->runAction(CCRepeatForever::create(static_cast<CCSequence *>(CCSequence::create(move, move->reverse(), NULL))));  
}  

 


补充:移动开发 , 其他 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,