0
현재이 코드를 사용하여 CCSprite (플레이어) 객체를 마지막 터치에 맞 춥니 다. 문제는 회전이 매우 불안정 해지고 매우 부드럽게 보이지 않는다는 것입니다.Cocos2D에서 터치하도록 CCSprite를 회전하십시오.
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를 사용해 보았지만 같은 문제가 발생합니다. 사전에
감사
@ 빅토르 렉싱턴에 대한 감사 밖으로 지적했다. –