I am making a game in which I want a sprite node to follow a circular movement, and with time the circles radius should gradually decrease to zero. I am assuming, this can be done by making a circular path using CGPath() and then decrease the paths radius by 1 point everytime the update() function is called.
Here is the code:
func createOrbit() -> (CGPath) {
let orbitPathOrigin = CGPoint(x: center.x , y: center.y)
let orbitPathRect = CGRect(origin: orbitPathOrigin, size: orbitSize)
let orbitPath = CGPathCreateWithEllipseInRect(orbitPathRect, nil)
return orbitPath
}
How do I refer to each of the path that is created and reduce their size?