Skip to content

Serialization Design

PaulAlger05 edited this page Apr 9, 2022 · 27 revisions

The file format we will use for saving the state of the game and all it's components will be a binary file. The binary file will be saved with the following format:

currentLevel
 totalEnemies
 screens
   entities
 currentScreen
 currentRow
 currentCol
...and so on

Where each variable corresponds to the variables of the object.

Ex.

  • currentLevel = The world's currentLevel variable (int)
    • totalEnemies = the currentLevel's totalEnemies variable (int)
    • screens = the list of screens the level has (Screen[][])

A small snippet from an example binary file would be the following: ``` 1 7 screen1 {entity1 , entity2, ... } 2 3 4 ```

Clone this wiki locally