-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First draft of hexaworld schema #1
base: master
Are you sure you want to change the base?
Conversation
…iles and b) convert .js to .json
"name": "hexaworld-schema", | ||
"version": "0.0.0", | ||
"description": "A schema and validation functions for hexaworld levels ", | ||
"main": "schema.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update to "main": "hexaworld.js"
maximum: 90 | ||
}, | ||
|
||
transformation: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't position be added into transformation too
It might be easier to reason about some of this if you also added a couple example |
] | ||
}, | ||
|
||
rectangle: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a separate rectangle that is not just a polygon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as an example because I imagine it'll be the most commonly used polygon. Think if anything we should add more specific polygons, because it'll make it easier to see what kind of shape there are in a tile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok - I get that. Can this be done in a way that it shares some features of polygon. Maybe want to be able call polygon with a center and a number of sides to generate a regular polygon (pointy top / flat top)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's not part of the schema though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I guess I was thinking polygon
would just let you specify faces if no other shape cuts it. polygon
, rectangle
, ellipse
and any other specific implementations all extend the shape
schema, which could have a center (or just a translation, and all shape centers are assumed to be the upper-left corner or something).
I'll have some examples tomorrow 👍 . For now, any issues with the high-level approach? Nick and I talked a bit about pros and cons of restricting all objects to be in tile sections (instead of defining a pixel-based coordinate system for the inside of the tiles), but I don't remember that being resolved. |
Oh, one more thing, all the objects at the top level of the Nobody is going to be seeing |
This is an untested first draft of the schema. Right now everything's inside one monolithic object, but the various independent components (basic, geometric, game) should be split up into separate schema files. Also, this is all in javascript using the
jsonschema
npm module, but for portability it should be a set of actual.json
files. That will be a simple conversion.There are a number of places where I put questions in comments. A few ones off the top of my head:
polygon
definition (using a triangular mesh). Seem good?