我試着在我的精靈的更新方法中做RotateBy。它只是翻譯。而不是旋轉。任何人都可以請告訴我該怎麼做?謝謝。如何同時旋轉和翻譯我的精靈? cocos2dx 3.2
void CBall::Update(float dt)
{
this->Start();
auto action = RotateBy::create(dt,10);
this->runAction(action);
}
void CBall::Start()
{
float currentX = getPositionX();
float distance = currentX + xOffset;
float time = distance/_speedX;
Vec2 destination = Vec2(distance,this->getPositionY());
auto actionMove = MoveTo::create(time,destination);
this->runAction(actionMove);
if(currentX > _screenWidth)
{
ReachedEndOfScreen();
}
}
發佈您的代碼開始()成員函數... – LearnCocos2D 2014-08-30 19:46:02