forked from bedohswe/p3he
Add "cross" as one of the "games".
This commit is contained in:
parent
88d6d30436
commit
d744d5f042
17
games/cross/__init__.py
Normal file
17
games/cross/__init__.py
Normal 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
1
games/cross/cross.json
Normal 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]}]
|
Loading…
Reference in New Issue
Block a user