0
我目前使用此代码来旋转CCSprite(播放器)对象以面对最后一次触摸。问题是这使得旋转变得非常激动,并且看起来不太平滑。旋转CCSprite以在Cocos2D中触摸
CGPoint playerPos = [player position];
CGPoint diff = CGPointMake(currentPoint.x-lastPoint.x, currentPoint.y-lastPoint.y);
CGPoint playerNewPos = ccpAdd(playerPos, diff);
[player setRotation:-CC_RADIANS_TO_DEGREES(atan2(playerNewPos.y-playerPos.y, playerNewPos.x-playerPos.x))];
我怎样才能让这段代码更流畅流畅?
我也尝试使用CCRotateTo但它导致相同的问题。
在此先感谢
@Viktor Lexington谢谢你指出这一点。 –