UNPKG

seed-engine

Version:

A Lightweight 2D game engine using WebGL2. The engine is designed on the focus of creating a bridge between creating and publishing games to the Seed Network as modules.

1,444 lines 32.9 kB
{ "type": "File", "start": 0, "end": 347, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 13, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 347, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 13, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 38, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 38 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 }, "identifierName": "Renderable" }, "name": "Renderable" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 37, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 37 } }, "extra": { "rawValue": "./Renderable", "raw": "'./Renderable'" }, "value": "./Renderable" } }, { "type": "ImportDeclaration", "start": 39, "end": 85, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 46 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 46, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "local": { "type": "Identifier", "start": 46, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 }, "identifierName": "Matrix3" }, "name": "Matrix3" } } ], "source": { "type": "StringLiteral", "start": 59, "end": 84, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 45 } }, "extra": { "rawValue": "../render/WebGL/Matrix3", "raw": "'../render/WebGL/Matrix3'" }, "value": "../render/WebGL/Matrix3" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Renderable2D is a renderable component which focusses on\n * 2D shaders and matricies for 2D space rendering.\n ", "start": 87, "end": 206, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 207, "end": 347, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 13, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 222, "end": 347, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 13, "column": 1 } }, "id": { "type": "Identifier", "start": 228, "end": 240, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 33 }, "identifierName": "Renderable2D" }, "name": "Renderable2D", "leadingComments": null }, "superClass": { "type": "Identifier", "start": 249, "end": 259, "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 52 }, "identifierName": "Renderable" }, "name": "Renderable" }, "body": { "type": "ClassBody", "start": 260, "end": 347, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 13, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 266, "end": 345, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 12, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 266, "end": 277, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 280, "end": 345, "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 12, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 290, "end": 298, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 16 } }, "expression": { "type": "CallExpression", "start": 290, "end": 297, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 15 } }, "callee": { "type": "Super", "start": 290, "end": 295, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 13 } } }, "arguments": [] } }, { "type": "ExpressionStatement", "start": 307, "end": 339, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 40 } }, "expression": { "type": "AssignmentExpression", "start": 307, "end": 338, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 39 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 307, "end": 321, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 22 } }, "object": { "type": "ThisExpression", "start": 307, "end": 311, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, "property": { "type": "Identifier", "start": 312, "end": 321, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 22 }, "identifierName": "className" }, "name": "className" }, "computed": false }, "right": { "type": "StringLiteral", "start": 324, "end": 338, "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 39 } }, "extra": { "rawValue": "Renderable2D", "raw": "'Renderable2D'" }, "value": "Renderable2D" } } } ], "directives": [] } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Renderable2D is a renderable component which focusses on\n * 2D shaders and matricies for 2D space rendering.\n ", "start": 87, "end": 206, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Renderable2D is a renderable component which focusses on\n * 2D shaders and matricies for 2D space rendering.\n ", "start": 87, "end": 206, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * Renderable2D is a renderable component which focusses on\n * 2D shaders and matricies for 2D space rendering.\n ", "start": 87, "end": 206, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Renderable", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 18, "end": 22, "loc": { "start": { "line": 1, "column": 18 }, "end": { "line": 1, "column": 22 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "./Renderable", "start": 23, "end": 37, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 37 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 37, "end": 38, "loc": { "start": { "line": 1, "column": 37 }, "end": { "line": 1, "column": 38 } } }, { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 39, "end": 45, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Matrix3", "start": 46, "end": 53, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 54, "end": 58, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 19 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "../render/WebGL/Matrix3", "start": 59, "end": 84, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 45 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 84, "end": 85, "loc": { "start": { "line": 2, "column": 45 }, "end": { "line": 2, "column": 46 } } }, { "type": "CommentBlock", "value": "*\n * Renderable2D is a renderable component which focusses on\n * 2D shaders and matricies for 2D space rendering.\n ", "start": 87, "end": 206, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 7, "column": 3 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 207, "end": 213, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 6 } } }, { "type": { "label": "default", "keyword": "default", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "default", "start": 214, "end": 221, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 14 } } }, { "type": { "label": "class", "keyword": "class", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "class", "start": 222, "end": 227, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 20 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Renderable2D", "start": 228, "end": 240, "loc": { "start": { "line": 8, "column": 21 }, "end": { "line": 8, "column": 33 } } }, { "type": { "label": "extends", "keyword": "extends", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "extends", "start": 241, "end": 248, "loc": { "start": { "line": 8, "column": 34 }, "end": { "line": 8, "column": 41 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Renderable", "start": 249, "end": 259, "loc": { "start": { "line": 8, "column": 42 }, "end": { "line": 8, "column": 52 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 260, "end": 261, "loc": { "start": { "line": 8, "column": 53 }, "end": { "line": 8, "column": 54 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "constructor", "start": 266, "end": 277, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 15 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 277, "end": 278, "loc": { "start": { "line": 9, "column": 15 }, "end": { "line": 9, "column": 16 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 278, "end": 279, "loc": { "start": { "line": 9, "column": 16 }, "end": { "line": 9, "column": 17 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 280, "end": 281, "loc": { "start": { "line": 9, "column": 18 }, "end": { "line": 9, "column": 19 } } }, { "type": { "label": "super", "keyword": "super", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "super", "start": 290, "end": 295, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 13 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 295, "end": 296, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 14 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 296, "end": 297, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 15 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 297, "end": 298, "loc": { "start": { "line": 10, "column": 15 }, "end": { "line": 10, "column": 16 } } }, { "type": { "label": "this", "keyword": "this", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "this", "start": 307, "end": 311, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 311, "end": 312, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "className", "start": 312, "end": 321, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 22 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 322, "end": 323, "loc": { "start": { "line": 11, "column": 23 }, "end": { "line": 11, "column": 24 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "Renderable2D", "start": 324, "end": 338, "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 39 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 338, "end": 339, "loc": { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 40 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 344, "end": 345, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 5 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 346, "end": 347, "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 13, "column": 1 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 347, "end": 347, "loc": { "start": { "line": 13, "column": 1 }, "end": { "line": 13, "column": 1 } } } ] }