Making a half circle path with CGPath, and follow the path with SKAction

Viewed 2544

I have no idea how to make a half circle path with CGPath. There is the code i have:

  let path = CGPathCreateMutable()
  let Width: CGFloat = 38.0
  let radius: CGFloat = (Width / 2.0) + (Treshold / 2.0)
  CGPathAddArc(pathOne, nil, x, 0.0, radius, firstPoint.position.x, secondPoint.position.x, true)
  let waitAction = SKAction.waitForDuration(1.0)
  let moveAction = SKAction.followPath(pathOne, duration: 3.0)
  capOne.runAction(SKAction.sequence([waitAction, moveAction]))
1 Answers
Related