init commit, working save game

This commit is contained in:
2023-04-24 00:00:49 +02:00
commit 254cda60e0
8 changed files with 236 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
from classes.GameBoard import GameBoard
from json import load as json_load
import lzma
if __name__ == '__main__':
with open("config.json", "r") as f:
CONFIG = json_load(f)
SAVE_STATE_FILE = {
"path": f"{CONFIG['save_file']['path']}/{CONFIG['save_file']['filename']}",
"compression": lzma,
"key": CONFIG["save_file"]["encryption_key"]
}
MAP_FILE = {
"path": f"{CONFIG['map_file']['path']}/{CONFIG['map_file']['filename']}",
"compression": lzma,
"key": CONFIG["map_file"]["encryption_key"]
}
game_board = GameBoard(CONFIG, SAVE_STATE_FILE, MAP_FILE)
saved_state = game_board.find_save_state()
print("Story Pos:", game_board.get_world())
print(game_board.map)
print(saved_state.get_player())