Since you can only read/write to these directories, $INSTALLDIR$, $SAVEGAMEDIR$ and $APPDATADIR$ (not even sure about INSTALLDIR) I chose to store my files in $SAVEGAMEDIR while they are still in development and I would have shipped the level in $INSTALLDIR.
The level files are custom binary files, created by the editor.
TENG::load_map and TENG::save_map can be found here:
https://github.com/dkrey/ags_krokus/blob/main/TENG.asc
They consist mostly of simple looped file writes like this:
Code: ags
The level files are custom binary files, created by the editor.
TENG::load_map and TENG::save_map can be found here:
https://github.com/dkrey/ags_krokus/blob/main/TENG.asc
They consist mostly of simple looped file writes like this:
//Save BG Tiles
j=0;
index = 0;
file.WriteInt(bg_tile_cnt);
while ( j < num_tiles_y ) {
i = 0;
while ( i < num_tiles_x ) {
if (tile[index].tileno[0]>0) {
file.WriteInt(index);
file.WriteInt(tile[index].mirrored_x[0]);
file.WriteInt(tile[index].mirrored_y[0]);
file.WriteInt(tile[index].tileno[0]);
}
index ++;
i++;
}
j++;
}