【发布时间】:2014-09-07 22:24:48
【问题描述】:
我的场景中有两个精灵,我想朝不同的方向移动。我通过搜索尝试了以下方法,但我无法得到任何工作。这是我迄今为止最好的。 如果有人能伸出援手,那就太好了。
-(void)touchMoved:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint touchLocation = [touch locationInNode:self];
if(CGRectContainsPoint([redLeash boundingBox], touchLocation))
{
redLeash.position = touchLocation;
}
else if
(CGRectContainsPoint([blueLeash boundingBox], touchLocation))
{
blueLeash.position = touchLocation;
}
}
【问题讨论】:
标签: objective-c cocos2d-iphone spritebuilder