I'm using quite large SpriteNodes to move my background (among things) in iOS Swift.
let runningBar = SKSpriteNode(imageNamed: "Bar")
self.addChild(self.scoreText)
It moves like this:
override func update(currentTime: NSTimeInterval) {
// Golf
updateRunningBarPosition()
}
func updateRunningBarPosition() {
runningBar.position.y = CGFloat(Double(runningBar.position.y) + createSinWave(angle) * 1)
self.angle += 0.01
}
This causes a frame rate drop from 60 fps to about 28-32.
How do I prevent this from happening?