import pygame.locals as pgl
import os
import sys
+import json
from .constants import DEBUG
from .loader import loader
def save_file_exists():
savefile = get_save_file_name()
return os.path.isfile(savefile)
+
+
+def write_save_file(json_data):
+ save_dir = save_location()
+ if not os.path.exists(save_dir):
+ os.makedirs(save_dir)
+ savefile = get_save_file_name()
+ with open(savefile, 'wb') as f:
+ json.dump(json_data, f, indent=3)