I have a sprite which I can drag across the screen. My question is how to make it also to rotate automatically.
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
if(_dead)
return;
NSArray *touchArray=[touches allObjects];
if ([touchArray count] == 1)
{
[_player runAction:[SKAction moveTo:[[touches anyObject] locationInNode:self] duration:0.01]];
}
}
Currently this is my code and it is working perfectly for draging.