Move incrementally a spritekitnode along path?

Hi i’m currently using Swift 2.0 and SpriteKit Framework to build a small 2D videogame.

I would develop a starship incrementally moving along a predefined path. The velocity and direction of the starship is determined from the user vertical swipe gesture.

Could someone suggest me how to proceed with the using of SpriteKit APIs ?

Thank you.

Do you mean the user will swipe on the screen and the created path will be used to move the ship? Iow, the path will not be straight lines?

Yes, i mean the user will swipe on the screen and the ship move incrementally along a predefined path.
The path is hardcoded!

This is a lot like an issue I had some years ago. I’m going to share the SO link to the question I wrote (the answer is CAMediaTiming, btw). But in the end I found it a lot simpler to animate with primitives like rotation around a point.

Are you doing a rails shooter kind of thing?

yeah, i tried to develop a simple game with 2 starships. One on the left and the other to the right of the mobile screen. I would to move them independently along the vertical axis, with a drag and drop gesture on them.

How can i reproduce it ?

Thank you

So the CAMediaTiming protocol is key. What you want to do is detect the pan gesture along the range of movement that you want to allow and translate that into time rather than distance. The you set the timeOffset property of the layer to move your object along the animation path. Did that stack overflow link help you at all?