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,428 lines • 30.8 kB
JSON
{
"type": "File",
"start": 0,
"end": 259,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 14,
"column": 30
}
},
"program": {
"type": "Program",
"start": 0,
"end": 259,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 14,
"column": 30
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
},
"identifierName": "Manager"
},
"name": "Manager"
}
}
],
"source": {
"type": "StringLiteral",
"start": 20,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 31
}
},
"extra": {
"rawValue": "./Manager",
"raw": "'./Manager'"
},
"value": "./Manager"
}
},
{
"type": "ExportNamedDeclaration",
"start": 34,
"end": 126,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 8,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 41,
"end": 126,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 8,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 47,
"end": 62,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 28
},
"identifierName": "_NetworkManager"
},
"name": "_NetworkManager"
},
"superClass": {
"type": "Identifier",
"start": 71,
"end": 78,
"loc": {
"start": {
"line": 3,
"column": 37
},
"end": {
"line": 3,
"column": 44
},
"identifierName": "Manager"
},
"name": "Manager"
},
"body": {
"type": "ClassBody",
"start": 79,
"end": 126,
"loc": {
"start": {
"line": 3,
"column": 45
},
"end": {
"line": 8,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 85,
"end": 123,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 6,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 85,
"end": 96,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 99,
"end": 123,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 6,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 109,
"end": 117,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 109,
"end": 116,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 109,
"end": 114,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
}
}
},
"arguments": []
}
}
],
"directives": []
}
}
],
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Singleton reference to the Network Manager.\n ",
"start": 128,
"end": 182,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
}
],
"leadingComments": []
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Singleton reference to the Network Manager.\n ",
"start": 128,
"end": 182,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"start": 183,
"end": 228,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 45
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 189,
"end": 227,
"loc": {
"start": {
"line": 13,
"column": 6
},
"end": {
"line": 13,
"column": 44
}
},
"id": {
"type": "Identifier",
"start": 189,
"end": 203,
"loc": {
"start": {
"line": 13,
"column": 6
},
"end": {
"line": 13,
"column": 20
},
"identifierName": "NetworkManager"
},
"name": "NetworkManager",
"leadingComments": null
},
"init": {
"type": "NewExpression",
"start": 206,
"end": 227,
"loc": {
"start": {
"line": 13,
"column": 23
},
"end": {
"line": 13,
"column": 44
}
},
"callee": {
"type": "Identifier",
"start": 210,
"end": 225,
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 42
},
"identifierName": "_NetworkManager"
},
"name": "_NetworkManager"
},
"arguments": []
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [],
"name": "_",
"trailingComments": []
},
{
"type": "Identifier",
"start": 229,
"end": 259,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 14,
"column": 30
}
},
"declaration": {
"type": "Identifier",
"start": 244,
"end": 258,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 29
},
"identifierName": "NetworkManager"
},
"name": "NetworkManager"
},
"name": "_",
"leadingComments": [],
"trailingComments": []
},
{
"type": "ExportDefaultDeclaration",
"start": 229,
"end": 259,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 14,
"column": 30
}
},
"declaration": {
"type": "VariableDeclaration",
"kind": "let",
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 14,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "NetworkManager"
},
"init": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "_NetworkManager"
}
}
}
],
"leadingComments": [],
"trailingComments": []
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentBlock",
"value": "*\n * Singleton reference to the Network Manager.\n ",
"start": 128,
"end": 182,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 12,
"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": "Manager",
"start": 7,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "from",
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
}
},
{
"type": {
"label": "string",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "./Manager",
"start": 20,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 31
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 31,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 31
},
"end": {
"line": 1,
"column": 32
}
}
},
{
"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": 34,
"end": 40,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 6
}
}
},
{
"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": 41,
"end": 46,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 12
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "_NetworkManager",
"start": 47,
"end": 62,
"loc": {
"start": {
"line": 3,
"column": 13
},
"end": {
"line": 3,
"column": 28
}
}
},
{
"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": 63,
"end": 70,
"loc": {
"start": {
"line": 3,
"column": 29
},
"end": {
"line": 3,
"column": 36
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "Manager",
"start": 71,
"end": 78,
"loc": {
"start": {
"line": 3,
"column": 37
},
"end": {
"line": 3,
"column": 44
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 79,
"end": 80,
"loc": {
"start": {
"line": 3,
"column": 45
},
"end": {
"line": 3,
"column": 46
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "constructor",
"start": 85,
"end": 96,
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 15
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 96,
"end": 97,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 4,
"column": 16
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 97,
"end": 98,
"loc": {
"start": {
"line": 4,
"column": 16
},
"end": {
"line": 4,
"column": 17
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 99,
"end": 100,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 4,
"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": 109,
"end": 114,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 114,
"end": 115,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 14
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 115,
"end": 116,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 15
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 116,
"end": 117,
"loc": {
"start": {
"line": 5,
"column": 15
},
"end": {
"line": 5,
"column": 16
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 122,
"end": 123,
"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": 125,
"end": 126,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 1
}
}
},
{
"type": "CommentBlock",
"value": "*\n * Singleton reference to the Network Manager.\n ",
"start": 128,
"end": 182,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 12,
"column": 3
}
}
},
{
"type": {
"label": "const",
"keyword": "const",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "const",
"start": 183,
"end": 188,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 5
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "NetworkManager",
"start": 189,
"end": 203,
"loc": {
"start": {
"line": 13,
"column": 6
},
"end": {
"line": 13,
"column": 20
}
}
},
{
"type": {
"label": "=",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": true,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "=",
"start": 204,
"end": 205,
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 22
}
}
},
{
"type": {
"label": "new",
"keyword": "new",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "new",
"start": 206,
"end": 209,
"loc": {
"start": {
"line": 13,
"column": 23
},
"end": {
"line": 13,
"column": 26
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "_NetworkManager",
"start": 210,
"end": 225,
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 42
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 225,
"end": 226,
"loc": {
"start": {
"line": 13,
"column": 42
},
"end": {
"line": 13,
"column": 43
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 226,
"end": 227,
"loc": {
"start": {
"line": 13,
"column": 43
},
"end": {
"line": 13,
"column": 44
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 227,
"end": 228,
"loc": {
"start": {
"line": 13,
"column": 44
},
"end": {
"line": 13,
"column": 45
}
}
},
{
"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": 229,
"end": 235,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 14,
"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": 236,
"end": 243,
"loc": {
"start": {
"line": 14,
"column": 7
},
"end": {
"line": 14,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "NetworkManager",
"start": 244,
"end": 258,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 29
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 258,
"end": 259,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 30
}
}
},
{
"type": {
"label": "eof",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 259,
"end": 259,
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 30
}
}
}
]
}