p3he/games/triangleroom/__init__.py

12 lines
319 B
Python

import importlib.resources as impr
import sys
import json
def init(serialize):
curm = sys.modules[__name__]
files = impr.files(curm)
level = None
with files.joinpath("triangle.json").open('r') as leveldir:
level = json.loads(leveldir.read(), object_hook=serialize.object_hook)
return level