0
我想在產生幾個矩形(SKShapeNodes)後改變speedOfRectangle。如何定期更改SKActions?
func wait(factor: CGFloat = 1) -> SKAction {
return SKAction.waitForDuration(NSTimeInterval(rectHeight * speedOfRectangle * distanceBetweenRectangles/factor))
}
let spawnSequence = SKAction.sequence([wait(), increaseCounter, spawnAction])
let spawnSequenceForever = SKAction.repeatActionForever(spawnSequence)
worldNode.runAction(spawnSequenceForever)
如何定期更改SKActions?