I am using a simple A* Pathfinding algorithm to create a path between two points (the green and red circles below), each square is an SKSpriteNode (with a CGPoint
[x,y] position). I want to animate another SKSpriteNode
along a smooth path that passes through each point.
My thinking was that I could use the SKAction
-followPath:duration:
to do this but I am having trouble working out how to create/specify the CGPath
. Any help would be much appreciated.
You can create a simple CGPath like this
Depending on what you want to achieve you can add different elements to your path like arcs, curves, rects... You can find more about it here.