I have an SKShape node that represents an ellipse. A player is placed on the current point of a Bezier Path that is based on the ellipse's CGPath:
I have two actions that the player node can perform. The player can either follow the path clockwise or counterclockwise.
rotateCounterClockwiseAction = SKAction.followPath(counterClockwisePath.CGPath, asOffset: false, orientToPath: true, duration: 1)
rotateClockwiseAction = SKAction.followPath(clockwisePath.CGPath, asOffset: false, orientToPath: true, duration: 1)
When I start one of the actions as:
player.runAction(SKAction.repeatActionForever(rotateClockwiseAction), withKey: "ClockwiseRotation")
The player moves along the appropriate path and direction. When I stop one of the actions:
player.removeActionForKey("ClockwiseRotation")
The player stops on the path where it was last moved to. I want to be able to start either of the actions from the player's current point, and follow the same path, but right now, if I start either one of the actions again (after an action has already been started and stopped) the player jumps to the same starting point as seen in the picture and follows the path from there. How can I get the player to follow the path from the point that it is already at?
let ellipse = SKShapeNode (ellipseOfSize: CGSizeMake(size.0, size.1))
, ie. not much experience in this area. Do you have some resource that might help me achieve this specifically? – JuJoDi