Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想选择一个精灵并将其移动到下一个触摸位置。
如何跟踪两个单独的触摸位置?
添加一个 ivar:
CGPoint previousLocation;
在触摸方法的末尾使用当前位置更新它:
-(void) ccTouchesBegan … etc { … previousLocation = touchLocation; }