Save map in file

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Solfieri

Hi, I’m from Brazil, so sorry for any English errors.
How do I save a whole map to a file? For example in Minecraft, when you put a block on the ground, it is saved, if you exit and return to the game, that block will be loaded … so how do I save the scenes I put on a map? When I leave and come back, they’re still there?

:bust_in_silhouette: Reply From: kidscancode

There are a few ways to approach this:

  • If you’re looking to save your actual game objects, the docs has a save game tutorial that may help get you started.

  • Alternatively, to save a map you can just save the data: object type, coordinates, etc. See the File object for how to read/write to a data file.