What method should I use to smoothly move my sprite that responds to a touch?
I am using the CCMoveTo method with the duration and the position of my touch is. My sprite moves but it (the sprite) skips over to the position which makes it jumpy. I want the sprite(one sprite controllable by the user) to follow my finger as it drags across the screen. Thank you in advance 🙂
-Dustin
*EDIT
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
return YES;
}
- (void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event {
CGPoint location = [self convertTouchToNodeSpace: touch];
//[player stopAllActions];
//[player runAction: [CCMoveTo actionWithDuration:.1 position:location]];
player.position = location;
}
That’s the code after I set the sprite directly to the location.
Try Like this…