Add "cross" as one of the "games".

This commit is contained in:
bʰedoh₂ swé 2024-04-07 23:52:58 +05:00
parent 88d6d30436
commit d744d5f042
2 changed files with 18 additions and 0 deletions

17
games/cross/__init__.py Normal file
View File

@ -0,0 +1,17 @@
import importlib.resources as impr
import sys
import json
import serialize
from engineevents import EngineEvent
def init(aoEngineEvents):
curm = sys.modules[__name__]
files = impr.files(curm)
level = None
with files.joinpath("cross.json").open('r') as leveldir:
level = json.loads(leveldir.read(), object_hook=serialize.object_hook)
aoEngineEvents.append(EngineEvent(
'level',
lambda _: level,
tsArguments=()
))

1
games/cross/cross.json Normal file
View File

@ -0,0 +1 @@
[{"__type__": "objSegment", "isFinite": false, "pointA": {"__type__": "complex", "real": 1.0, "imag": 0.0}, "pointB": {"__type__": "complex", "real": 0.0, "imag": 0.0}, "color": [255, 0, 0]}, {"__type__": "objSegment", "isFinite": false, "pointA": {"__type__": "complex", "real": 0.0, "imag": 1.0}, "pointB": {"__type__": "complex", "real": 0.0, "imag": 0.0}, "color": [0, 255, 0]}]