Saves
Info
Dependencies:
- BinaryMachines
Implementation:
Saves.d on GitHub
Offers an open file stream that can read/write variables on save/load. It is used by PermMem, so you don't need to address it manually anymore.
Initialization
Initialize with LeGo_Saves
flag.
Functions
BW_Savegame
BW_Savegame
Custom function. It creates a stream to its own memory file, this can be filled with the BW_*
functions from the BinaryMachines.
BR_Savegame
BR_Savegame
Custom function. It opens a stream to a previously saved memory file, which can be read from the BinaryMachines using the BR_*
functions.
Examples
Save a high score list
Since strings are not saved by the game by default, we use the functions from Saves.d
to create an additional memory file that only belongs to us. At the top the Saves.d file has two functions: BW_Savegame
and BR_Savegame
. BinaryMachines functions are used to save or read the file, we don't need to do anything else than to use them here, the rest is done by Saves.d
completely by itself. Therefore, we only modify these two functions.
Tip
Since LeGo 2.0, such things can be implemented much more elegantly with PermMem.