, :
, :
let follow = SKAction.followPath(path.CGPath, asOffset: false, orientToPath: true, speed: 200)
player.runAction(SKAction.repeatActionForever(follow).reversedAction(),withKey:"followPath")
:
player.removeActionForKey("followPath")
, :
var myCircle : CGMutablePath! = CGPathCreateMutable()
let newDx = player.position.x - self.frame.width / 2
let newDy = player.position.y - self.frame.height / 2
let newRad = atan2(newDy, newDx)
let newPath = UIBezierPath(arcCenter: CGPoint(x:self.frame.width / 2, y: self.frame.height / 2) , radius: 170, startAngle: newRad, endAngle: newRad + CGFloat(M_PI * 4), clockwise: true)
, :
var mirroring = CGAffineTransformMakeScale(1.0, -1.0)
var mirrorPath : CGMutablePath! = CGPathCreateMutable()
CGPathAddPath(mirrorPath, &mirroring, newPath.CGPath)
:
let newFollow = SKAction.followPath(mirrorPath, asOffset: false, orientToPath: true, speed: 200)
player.runAction(SKAction.repeatActionForever(newFollow).reversedAction(),withKey:"followPath")
:
- , , , CGPoint ( "moveToPoint" ). CGPath :
var mirrorPoints = mirrorPath.getPathElementsPoints()
let destinationPoint = mirrorPoints.first!
Sprite-kit jumpAction SKAction's, .
"" Y, , ().