0

I'm currently working on a dungeon crawler type of game (in Swift), and I would like to know how to preserve scenes when the game transfers between different scenes. I know how to save(encode) a scene and reload it. But what I'm trying to do is the for each level, the main dungeon has a few exits: A, B, C that connects to other smaller areas/sub-dungeon. In the effort of keeping the map relatively small, I have broken them into different scenes. And here is my question: How do I preserve these scenes when I transfer between them, meaning when I go back to a previously visited scene, all things stay the way how I left them (dead monsters stay dead and opened chests stay opened), instead of reloading a fresh scene. Any help would be appreciated!

Thanks in advance.

Bob
  • 155
  • 1
  • 8
  • I don't understand why you think reloading a scene is different than going back to a previously visited scene. – Robert Harvey Dec 31 '18 at 18:10
  • I have only one GameScene where all the game play happens, and every time player completes one map the GameScene loads another TileMapNode. If I encode the GameScene itself does it also encode the progress player made in each map? – Bob Dec 31 '18 at 22:52
  • @RobertHarvey Because the OP obviously thinks that when he reloads a scene, he'll get a new copy with everything reset. – Steve Ives Jan 02 '19 at 13:23
  • @SteveIves: Sounds like you have enough insight to provide an answer to the question. – Robert Harvey Jan 02 '19 at 14:16
  • Maybe I didn't make myself clear. What I'm trying to do is to be able to save the progress player made on each map/scene. I know how to encode a particular game scene, and let player later pick up from where he/she left off. But how do I do that for each of the map/scene the player had visited? – Bob Jan 07 '19 at 16:42

0 Answers0