如何将高分保存并打印到下一个场景?

时间:2015-05-21 03:36:26

标签: ios swift sprite-kit skspritenode

嘿伙计们正在寻求帮助。我是新制作的游戏和东西,所以这对我来说有点困难。我试图保存得分并将其打印到GameScene.swift的GameOverScene.swift中,有什么建议吗?

1 个答案:

答案 0 :(得分:2)

一些选项可能是:

1. Save highscore in app delegate. I gameover scene print it from appDelegate.
2. Save highscore in NSUserDefault. then in GameOverScene show it form there.
3. Create a property in GameOverScene and while navigating to GameOverSecne from GameScene set that property.

以下是NSUserDefaultPassing data between ViewControllers的一些教程。

希望这有助于......:)