Wednesday, January 18, 2012

Saving and Loading Changes

Before when you saved a level it saved the entire level into one file containing the information of all the objects (wormholes, stars, etc.). This made the level folder look like this, with each level contained in a file:


The reason this is bad is because I am saving the level bit-by-bit. This means that if I make any changes to what is inside a level, i.e. what is saved and loaded, then attempting to load a level template that does not exactly match the current one will result in a crash. What happens now instead is each component of the level is saved and loaded separately in their own files. This allows me to check which files exist and which do not and prevent the game from crashing every time I add something to a level. Here is what the new level folder will look like:

And inside each level folder:


No comments:

Post a Comment