2012-08-30 2 views
-1

저는 Cocos2D를 사용하여 간단한 게임을 만들고 있습니다. 사용자는 작은 움직이는 물체의 경로를 만지고 추적 할 수 있습니다. 그런 다음 개체가 경로를 따릅니다. 이것은 비행 제어 게임 메카닉과 유사합니다.iPhone 용 Cocos2D로 곡선 드로잉

이 문제를 해결하는 데 도움이되는 that.please와 같은 객체를 어떻게 움직일 수 있습니까? 모든 샘플 코드 또는 자습서는 저에게 더 감사드립니다. 당신의 touchesEnded /는 touchesMoved 방법에

답변

0

노력이 수행

UITouch *touch = [touches anyObject]; 

if (touch) { 
    CGPoint location = [touch locationInView:[touch view]]; 
    CGPoint convertedPoint = [[CCDirector sharedDirector] convertToGL:location]; 
    id animation = [CCMoveTo actionWithDuration:0.1 position:convertedPoint]; 
    [playerShip runAction:animation]; 
    } 
관련 문제