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,587 lines (1,586 loc) 1.08 MB
{ "type": "File", "start": 0, "end": 5008, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 176, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5008, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 176, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 125, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 125 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 9, "end": 24, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 } }, "imported": { "type": "Identifier", "start": 9, "end": 24, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 }, "identifierName": "ClickController" }, "name": "ClickController" }, "local": { "type": "Identifier", "start": 9, "end": 24, "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 24 }, "identifierName": "ClickController" }, "name": "ClickController" } }, { "type": "ImportSpecifier", "start": 26, "end": 31, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 31 } }, "imported": { "type": "Identifier", "start": 26, "end": 31, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 31 }, "identifierName": "Point" }, "name": "Point" }, "local": { "type": "Identifier", "start": 26, "end": 31, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 31 }, "identifierName": "Point" }, "name": "Point" } }, { "type": "ImportSpecifier", "start": 33, "end": 44, "loc": { "start": { "line": 1, "column": 33 }, "end": { "line": 1, "column": 44 } }, "imported": { "type": "Identifier", "start": 33, "end": 44, "loc": { "start": { "line": 1, "column": 33 }, "end": { "line": 1, "column": 44 }, "identifierName": "SceneObject" }, "name": "SceneObject" }, "local": { "type": "Identifier", "start": 33, "end": 44, "loc": { "start": { "line": 1, "column": 33 }, "end": { "line": 1, "column": 44 }, "identifierName": "SceneObject" }, "name": "SceneObject" } }, { "type": "ImportSpecifier", "start": 46, "end": 58, "loc": { "start": { "line": 1, "column": 46 }, "end": { "line": 1, "column": 58 } }, "imported": { "type": "Identifier", "start": 46, "end": 58, "loc": { "start": { "line": 1, "column": 46 }, "end": { "line": 1, "column": 58 }, "identifierName": "Renderable2D" }, "name": "Renderable2D" }, "local": { "type": "Identifier", "start": 46, "end": 58, "loc": { "start": { "line": 1, "column": 46 }, "end": { "line": 1, "column": 58 }, "identifierName": "Renderable2D" }, "name": "Renderable2D" } }, { "type": "ImportSpecifier", "start": 60, "end": 69, "loc": { "start": { "line": 1, "column": 60 }, "end": { "line": 1, "column": 69 } }, "imported": { "type": "Identifier", "start": 60, "end": 69, "loc": { "start": { "line": 1, "column": 60 }, "end": { "line": 1, "column": 69 }, "identifierName": "UIManager" }, "name": "UIManager" }, "local": { "type": "Identifier", "start": 60, "end": 69, "loc": { "start": { "line": 1, "column": 60 }, "end": { "line": 1, "column": 69 }, "identifierName": "UIManager" }, "name": "UIManager" } }, { "type": "ImportSpecifier", "start": 71, "end": 80, "loc": { "start": { "line": 1, "column": 71 }, "end": { "line": 1, "column": 80 } }, "imported": { "type": "Identifier", "start": 71, "end": 80, "loc": { "start": { "line": 1, "column": 71 }, "end": { "line": 1, "column": 80 }, "identifierName": "UIElement" }, "name": "UIElement" }, "local": { "type": "Identifier", "start": 71, "end": 80, "loc": { "start": { "line": 1, "column": 71 }, "end": { "line": 1, "column": 80 }, "identifierName": "UIElement" }, "name": "UIElement" } }, { "type": "ImportSpecifier", "start": 82, "end": 94, "loc": { "start": { "line": 1, "column": 82 }, "end": { "line": 1, "column": 94 } }, "imported": { "type": "Identifier", "start": 82, "end": 94, "loc": { "start": { "line": 1, "column": 82 }, "end": { "line": 1, "column": 94 }, "identifierName": "InputManager" }, "name": "InputManager" }, "local": { "type": "Identifier", "start": 82, "end": 94, "loc": { "start": { "line": 1, "column": 82 }, "end": { "line": 1, "column": 94 }, "identifierName": "InputManager" }, "name": "InputManager" } }, { "type": "ImportSpecifier", "start": 96, "end": 103, "loc": { "start": { "line": 1, "column": 96 }, "end": { "line": 1, "column": 103 } }, "imported": { "type": "Identifier", "start": 96, "end": 103, "loc": { "start": { "line": 1, "column": 96 }, "end": { "line": 1, "column": 103 }, "identifierName": "KeyCode" }, "name": "KeyCode" }, "local": { "type": "Identifier", "start": 96, "end": 103, "loc": { "start": { "line": 1, "column": 96 }, "end": { "line": 1, "column": 103 }, "identifierName": "KeyCode" }, "name": "KeyCode" } } ], "source": { "type": "StringLiteral", "start": 111, "end": 124, "loc": { "start": { "line": 1, "column": 111 }, "end": { "line": 1, "column": 124 } }, "extra": { "rawValue": "../../entry", "raw": "'../../entry'" }, "value": "../../entry" } }, { "type": "ImportDeclaration", "start": 126, "end": 158, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 32 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 133, "end": 140, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 } }, "local": { "type": "Identifier", "start": 133, "end": 140, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 14 }, "identifierName": "UIPanel" }, "name": "UIPanel" } } ], "source": { "type": "StringLiteral", "start": 146, "end": 157, "loc": { "start": { "line": 2, "column": 20 }, "end": { "line": 2, "column": 31 } }, "extra": { "rawValue": "./UIPanel", "raw": "'./UIPanel'" }, "value": "./UIPanel" } }, { "type": "ImportDeclaration", "start": 159, "end": 189, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 30 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 166, "end": 172, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 } }, "local": { "type": "Identifier", "start": 166, "end": 172, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 13 }, "identifierName": "UIText" }, "name": "UIText" } } ], "source": { "type": "StringLiteral", "start": 178, "end": 188, "loc": { "start": { "line": 3, "column": 19 }, "end": { "line": 3, "column": 29 } }, "extra": { "rawValue": "./UIText", "raw": "'./UIText'" }, "value": "./UIText" } }, { "type": "ExportDefaultDeclaration", "start": 191, "end": 5005, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 173, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 206, "end": 5005, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 173, "column": 1 } }, "id": { "type": "Identifier", "start": 212, "end": 223, "loc": { "start": { "line": 5, "column": 21 }, "end": { "line": 5, "column": 32 }, "identifierName": "UITextInput" }, "name": "UITextInput" }, "superClass": { "type": "Identifier", "start": 232, "end": 241, "loc": { "start": { "line": 5, "column": 41 }, "end": { "line": 5, "column": 50 }, "identifierName": "UIElement" }, "name": "UIElement" }, "body": { "type": "ClassBody", "start": 242, "end": 5005, "loc": { "start": { "line": 5, "column": 51 }, "end": { "line": 173, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 250, "end": 1632, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 51, "column": 5 } }, "static": false, "computed": false, "key": { "type": "Identifier", "start": 250, "end": 261, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 17 }, "identifierName": "constructor" }, "name": "constructor" }, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 262, "end": 270, "loc": { "start": { "line": 6, "column": 18 }, "end": { "line": 6, "column": 26 }, "identifierName": "viewport" }, "name": "viewport" }, { "type": "Identifier", "start": 272, "end": 273, "loc": { "start": { "line": 6, "column": 28 }, "end": { "line": 6, "column": 29 }, "identifierName": "x" }, "name": "x" }, { "type": "Identifier", "start": 275, "end": 276, "loc": { "start": { "line": 6, "column": 31 }, "end": { "line": 6, "column": 32 }, "identifierName": "y" }, "name": "y" }, { "type": "Identifier", "start": 278, "end": 279, "loc": { "start": { "line": 6, "column": 34 }, "end": { "line": 6, "column": 35 }, "identifierName": "w" }, "name": "w" }, { "type": "Identifier", "start": 281, "end": 282, "loc": { "start": { "line": 6, "column": 37 }, "end": { "line": 6, "column": 38 }, "identifierName": "h" }, "name": "h" }, { "type": "AssignmentPattern", "start": 284, "end": 293, "loc": { "start": { "line": 6, "column": 40 }, "end": { "line": 6, "column": 49 } }, "left": { "type": "Identifier", "start": 284, "end": 288, "loc": { "start": { "line": 6, "column": 40 }, "end": { "line": 6, "column": 44 }, "identifierName": "text" }, "name": "text" }, "right": { "type": "StringLiteral", "start": 291, "end": 293, "loc": { "start": { "line": 6, "column": 47 }, "end": { "line": 6, "column": 49 } }, "extra": { "rawValue": "", "raw": "''" }, "value": "" } }, { "type": "AssignmentPattern", "start": 295, "end": 315, "loc": { "start": { "line": 6, "column": 51 }, "end": { "line": 6, "column": 71 } }, "left": { "type": "Identifier", "start": 295, "end": 308, "loc": { "start": { "line": 6, "column": 51 }, "end": { "line": 6, "column": 64 }, "identifierName": "requiresFocus" }, "name": "requiresFocus" }, "right": { "type": "BooleanLiteral", "start": 311, "end": 315, "loc": { "start": { "line": 6, "column": 67 }, "end": { "line": 6, "column": 71 } }, "value": true } } ], "body": { "type": "BlockStatement", "start": 317, "end": 1632, "loc": { "start": { "line": 6, "column": 73 }, "end": { "line": 51, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 327, "end": 376, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 57 } }, "expression": { "type": "CallExpression", "start": 327, "end": 375, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 56 } }, "callee": { "type": "Super", "start": 327, "end": 332, "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 13 } } }, "arguments": [ { "type": "NewExpression", "start": 333, "end": 351, "loc": { "start": { "line": 7, "column": 14 }, "end": { "line": 7, "column": 32 } }, "callee": { "type": "Identifier", "start": 337, "end": 342, "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 7, "column": 23 }, "identifierName": "Point" }, "name": "Point" }, "arguments": [ { "type": "Identifier", "start": 343, "end": 344, "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 25 }, "identifierName": "x" }, "name": "x" }, { "type": "Identifier", "start": 346, "end": 347, "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 28 }, "identifierName": "y" }, "name": "y" }, { "type": "NumericLiteral", "start": 349, "end": 350, "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 7, "column": 31 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } ] }, { "type": "NewExpression", "start": 353, "end": 371, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 7, "column": 52 } }, "callee": { "type": "Identifier", "start": 357, "end": 362, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 7, "column": 43 }, "identifierName": "Point" }, "name": "Point" }, "arguments": [ { "type": "Identifier", "start": 363, "end": 364, "loc": { "start": { "line": 7, "column": 44 }, "end": { "line": 7, "column": 45 }, "identifierName": "w" }, "name": "w" }, { "type": "Identifier", "start": 366, "end": 367, "loc": { "start": { "line": 7, "column": 47 }, "end": { "line": 7, "column": 48 }, "identifierName": "h" }, "name": "h" }, { "type": "NumericLiteral", "start": 369, "end": 370, "loc": { "start": { "line": 7, "column": 50 }, "end": { "line": 7, "column": 51 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } ] }, { "type": "NumericLiteral", "start": 373, "end": 374, "loc": { "start": { "line": 7, "column": 54 }, "end": { "line": 7, "column": 55 } }, "extra": { "rawValue": 0, "raw": "0" }, "value": 0 } ] } }, { "type": "ExpressionStatement", "start": 386, "end": 403, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 25 } }, "expression": { "type": "AssignmentExpression", "start": 386, "end": 402, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 24 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 386, "end": 395, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 17 } }, "object": { "type": "ThisExpression", "start": 386, "end": 390, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 12 } } }, "property": { "type": "Identifier", "start": 391, "end": 395, "loc": { "start": { "line": 9, "column": 13 }, "end": { "line": 9, "column": 17 }, "identifierName": "text" }, "name": "text" }, "computed": false }, "right": { "type": "Identifier", "start": 398, "end": 402, "loc": { "start": { "line": 9, "column": 20 }, "end": { "line": 9, "column": 24 }, "identifierName": "text" }, "name": "text" } } }, { "type": "ExpressionStatement", "start": 412, "end": 431, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 27 } }, "expression": { "type": "AssignmentExpression", "start": 412, "end": 430, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 26 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 412, "end": 425, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 21 } }, "object": { "type": "ThisExpression", "start": 412, "end": 416, "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 12 } } }, "property": { "type": "Identifier", "start": 417, "end": 425, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 21 }, "identifierName": "baseText" }, "name": "baseText" }, "computed": false }, "right": { "type": "StringLiteral", "start": 428, "end": 430, "loc": { "start": { "line": 10, "column": 24 }, "end": { "line": 10, "column": 26 } }, "extra": { "rawValue": "", "raw": "''" }, "value": "" } }, "trailingComments": [ { "type": "CommentLine", "value": "preceeding text always there.", "start": 432, "end": 463, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 59 } } } ] }, { "type": "ExpressionStatement", "start": 472, "end": 493, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 29 } }, "expression": { "type": "AssignmentExpression", "start": 472, "end": 492, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 28 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 472, "end": 485, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 21 } }, "object": { "type": "ThisExpression", "start": 472, "end": 476, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 477, "end": 485, "loc": { "start": { "line": 11, "column": 13 }, "end": { "line": 11, "column": 21 }, "identifierName": "textView" }, "name": "textView" }, "computed": false, "leadingComments": null }, "right": { "type": "Identifier", "start": 488, "end": 492, "loc": { "start": { "line": 11, "column": 24 }, "end": { "line": 11, "column": 28 }, "identifierName": "text" }, "name": "text" }, "leadingComments": null }, "leadingComments": [ { "type": "CommentLine", "value": "preceeding text always there.", "start": 432, "end": 463, "loc": { "start": { "line": 10, "column": 28 }, "end": { "line": 10, "column": 59 } } } ] }, { "type": "ExpressionStatement", "start": 502, "end": 532, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 38 } }, "expression": { "type": "AssignmentExpression", "start": 502, "end": 531, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 37 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 502, "end": 523, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 29 } }, "object": { "type": "ThisExpression", "start": 502, "end": 506, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 507, "end": 523, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 29 }, "identifierName": "textViewPassword" }, "name": "textViewPassword" }, "computed": false }, "right": { "type": "BooleanLiteral", "start": 526, "end": 531, "loc": { "start": { "line": 12, "column": 32 }, "end": { "line": 12, "column": 37 } }, "value": false } } }, { "type": "ExpressionStatement", "start": 542, "end": 553,