I have build a swift game with a "GameViewController.swift"
import UIKit
import SpriteKit
class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let scene = GameScene(fileNamed:"GameScene") {
// Configure the view.
let skView = self.view as! SKView
/* Set the scale mode to scale to fit the window */
scene.scaleMode = .AspectFill
skView.presentScene(scene)
}
}
}
and i have a scene called "GameScene"(it is the default game-file when you open swift and create a new swift game)
import UIKit
import SpriteKit
class GameScene: SKScene{
var building = SKSpriteNode()
override func didMoveToView(view: SKView) {
/* Setup your scene here */
}
a lot of things going on there. (buildings can be placed and that trigger some actions and so on)
But all the progress is lost when you leave the app.
How to save the whole progress of this "GameScene" and reload it at the start?