2016-10-30 26 views
1

我們正在嘗試更新iOS中的老式迷宮遊戲objective-c 我不知道任何關於iOS中使用的精靈(遊戲)的事情。 我正嘗試在迷宮遊戲中移動卡車, 卡車圖像在CCsprite中使用,所以如何在CCSprite中將卡車圖像旋轉到每個位置。如何在iOS目標c中觸摸CCSprite中的卡車圖像?

_player = [CCSprite spriteWithFile:@"trolley_ipad.png"]; 


- (void)ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event 
{ 

} 
+0

爲了得到你需要提供更詳細的良好的反應。 –

回答

0

您設置一個(錨)指向繞:

_player.anchorPoint = cpp(anchorX, anchorY); 

,並將其旋轉:

_player.rotation = 90;