I'm trying to generate new nodes in scene
func generateNewPlatform(inScene: SKScene) {
for _ in 0...25 {
let xPosition = randomXPosition()
let yPosition = randomYPosition()
let platform = Platform.create(
platform.position = CGPoint(x: xPosition, y: yPosition)
inScene.addChild(platform)
}
}
I need to generate it every 10 seconds, of course I remove old by
removeFromParent()
But when I do it, it causing frame drop (1-5, depending on the device)
How can I handle this frame drop?