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,334 lines 32.3 kB
{ "type": "File", "start": 0, "end": 141, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 7, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 141, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 7, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ExportDefaultDeclaration", "start": 0, "end": 141, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 7, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 15, "end": 141, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 7, "column": 1 } }, "id": { "type": "Identifier", "start": 21, "end": 27, "loc": { "start": { "line": 1, "column": 21 }, "end": { "line": 1, "column": 27 }, "identifierName": "Shader" }, "name": "Shader" }, "superClass": null, "body": { "type": "ClassBody", "start": 28, "end": 141, "loc": { "start": { "line": 1, "column": 28 }, "end": { "line": 7, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 34, "end": 139, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 6, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 34, "end": 45, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 48, "end": 139, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 6, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 58, "end": 75, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 58, "end": 74, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 58, "end": 69, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 19 } }, "object": { "type": "ThisExpression", "start": 58, "end": 62, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 12 } } }, "property": { "type": "Identifier", "start": 63, "end": 69, "loc": { "start": { "line": 3, "column": 13 }, "end": { "line": 3, "column": 19 }, "identifierName": "source" }, "name": "source" }, "computed": false }, "right": { "type": "TemplateLiteral", "start": 72, "end": 74, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 24 } }, "expressions": [], "quasis": [ { "type": "TemplateElement", "start": 73, "end": 73, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 23 } }, "value": { "raw": "", "cooked": "" }, "tail": true } ] } } }, { "type": "ExpressionStatement", "start": 84, "end": 105, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 84, "end": 104, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 84, "end": 97, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 21 } }, "object": { "type": "ThisExpression", "start": 84, "end": 88, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 12 } } }, "property": { "type": "Identifier", "start": 89, "end": 97, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 21 }, "identifierName": "compiled" }, "name": "compiled" }, "computed": false }, "right": { "type": "NullLiteral", "start": 100, "end": 104, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 28 } } } } }, { "type": "ExpressionStatement", "start": 114, "end": 133, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 114, "end": 132, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 114, "end": 127, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 21 } }, "object": { "type": "ThisExpression", "start": 114, "end": 118, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 12 } } }, "property": { "type": "Identifier", "start": 119, "end": 127, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 21 }, "identifierName": "uniforms" }, "name": "uniforms" }, "computed": false }, "right": { "type": "ObjectExpression", "start": 130, "end": 132, "loc": { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 26 } }, "properties": [] } } } ], "directives": [] } } ] }, "leadingComments": [], "trailingComments": [] } } ], "directives": [] }, "comments": [], "tokens": [ { "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": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "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": 7, "end": 14, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "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": 15, "end": 20, "loc": { "start": { "line": 1, "column": 15 }, "end": { "line": 1, "column": 20 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Shader", "start": 21, "end": 27, "loc": { "start": { "line": 1, "column": 21 }, "end": { "line": 1, "column": 27 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 28, "end": 29, "loc": { "start": { "line": 1, "column": 28 }, "end": { "line": 1, "column": 29 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "constructor", "start": 34, "end": 45, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 15 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 45, "end": 46, "loc": { "start": { "line": 2, "column": 15 }, "end": { "line": 2, "column": 16 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 46, "end": 47, "loc": { "start": { "line": 2, "column": 16 }, "end": { "line": 2, "column": 17 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 48, "end": 49, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 19 } } }, { "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": 58, "end": 62, "loc": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 62, "end": 63, "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "source", "start": 63, "end": 69, "loc": { "start": { "line": 3, "column": 13 }, "end": { "line": 3, "column": 19 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 70, "end": 71, "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 21 } } }, { "type": { "label": "`", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 72, "end": 73, "loc": { "start": { "line": 3, "column": 22 }, "end": { "line": 3, "column": 23 } } }, { "type": { "label": "template", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "", "start": 73, "end": 73, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 23 } } }, { "type": { "label": "`", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 73, "end": 74, "loc": { "start": { "line": 3, "column": 23 }, "end": { "line": 3, "column": 24 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 74, "end": 75, "loc": { "start": { "line": 3, "column": 24 }, "end": { "line": 3, "column": 25 } } }, { "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": 84, "end": 88, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 88, "end": 89, "loc": { "start": { "line": 4, "column": 12 }, "end": { "line": 4, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "compiled", "start": 89, "end": 97, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 21 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 98, "end": 99, "loc": { "start": { "line": 4, "column": 22 }, "end": { "line": 4, "column": 23 } } }, { "type": { "label": "null", "keyword": "null", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "null", "start": 100, "end": 104, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 28 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 104, "end": 105, "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 29 } } }, { "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": 114, "end": 118, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 12 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 118, "end": 119, "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "uniforms", "start": 119, "end": 127, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 21 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 128, "end": 129, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 23 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 130, "end": 131, "loc": { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 25 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 131, "end": 132, "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 5, "column": 26 } } }, { "type": { "label": ";", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 132, "end": 133, "loc": { "start": { "line": 5, "column": 26 }, "end": { "line": 5, "column": 27 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 138, "end": 139, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 5 } } }, { "type": { "label": "}", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 140, "end": 141, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 1 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 141, "end": 141, "loc": { "start": { "line": 7, "column": 1 }, "end": { "line": 7, "column": 1 } } } ] }