嘿伙计们正在寻求帮助。我是新制作的游戏和东西,所以这对我来说有点困难。我试图保存得分并将其打印到GameScene.swift的GameOverScene.swift中,有什么建议吗?
答案 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.
以下是NSUserDefault,Passing data between ViewControllers的一些教程。
希望这有助于......:)