我在编码时遇到问题,使特定精灵在数组中移动....
-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch* myTouch = [touches anyObject];
CGPoint location = [myTouch locationInView: [myTouch view]];
location = [[CCDirector sharedDirector]convertToGL:location];
CCSprite*grade=[grades lastObject];
[grade runAction:[CCMoveTo actionWithDuration:3 position:location]];
}
数组移动的最后一个对象..
你能帮我更正代码以触摸数组中的特定精灵,并在ccTouchesMove
方法中对其进行移动吗?
PS我只使用cocos2d,而不是box2d。