control max speed in sprite kit
问题 I'm trying to control the max speed of my character in my game. When I move him I use this: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint positionInScene = [touch locationInNode:self]; SKSpriteNode *touchedNode = (SKSpriteNode *)[self nodeAtPoint:positionInScene]; CGPoint posicionHero = [self childNodeWithName:@"hero"].position; SKSpriteNode *touchHero = (SKSpriteNode *)[self nodeAtPoint:posicionHero]; if((touchedNode !