I am trying create a CGPath for a node to follow but when I have tried using SKShapeNode as defined in the actions and constants slide from 608_hd_best_practices_for_buildin
init(splinePoints:count:)
takes an UnsafeMutablePointer
(i.e., a C array of CGPoint
s) and an unsigned integer as its arguments. It also returns an SKShapeNode
object not a CGPathRef
. Try the following...
let p = SKShapeNode(splinePoints: &path, count: UInt(count))
EDIT: Make the following changes as well
let speed:CGFloat = 1.0
let action = SKAction.followPath(p.path, speed: speed)
sprite.runAction(action)