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,457 lines • 33.1 kB
JSON
{
"type": "File",
"start": 0,
"end": 428,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 428,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 288,
"end": 428,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 303,
"end": 428,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 20,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 309,
"end": 316,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 28
},
"identifierName": "Manager"
},
"name": "Manager",
"leadingComments": null
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 317,
"end": 428,
"loc": {
"start": {
"line": 10,
"column": 29
},
"end": {
"line": 20,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 323,
"end": 345,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 323,
"end": 334,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 337,
"end": 345,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 13,
"column": 5
}
},
"body": [],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 355,
"end": 365,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 14
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 355,
"end": 360,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
},
"identifierName": "start"
},
"name": "start"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 363,
"end": 365,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 14
}
},
"body": [],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 370,
"end": 381,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 15
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 370,
"end": 376,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 10
},
"identifierName": "update"
},
"name": "update"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 379,
"end": 381,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 15
}
},
"body": [],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 386,
"end": 394,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 12
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 386,
"end": 389,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 7
},
"identifierName": "end"
},
"name": "end"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 392,
"end": 394,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 12
}
},
"body": [],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 399,
"end": 409,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 14
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 399,
"end": 404,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 9
},
"identifierName": "pause"
},
"name": "pause"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 407,
"end": 409,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 14
}
},
"body": [],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 414,
"end": 426,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 16
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 414,
"end": 421,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 11
},
"identifierName": "unpause"
},
"name": "unpause"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 424,
"end": 426,
"loc": {
"start": {
"line": 19,
"column": 14
},
"end": {
"line": 19,
"column": 16
}
},
"body": [],
"directives": []
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Baseclass for all Managers.\n * \n * In order for a new Manager to be added to the engine, it must inherit\n * this class and define these functions to be recognized by the Engine.\n * \n * TODO: Finish Plugins in Engine Manager & implement optional function calls on updateables.\n ",
"start": 0,
"end": 286,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
],
"trailingComments": []
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * Baseclass for all Managers.\n * \n * In order for a new Manager to be added to the engine, it must inherit\n * this class and define these functions to be recognized by the Engine.\n * \n * TODO: Finish Plugins in Engine Manager & implement optional function calls on updateables.\n ",
"start": 0,
"end": 286,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
]
}
],
"directives": []
},
"comments": [
{
"type": "CommentBlock",
"value": "*\n * Baseclass for all Managers.\n * \n * In order for a new Manager to be added to the engine, it must inherit\n * this class and define these functions to be recognized by the Engine.\n * \n * TODO: Finish Plugins in Engine Manager & implement optional function calls on updateables.\n ",
"start": 0,
"end": 286,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"column": 3
}
}
}
],
"tokens": [
{
"type": "CommentBlock",
"value": "*\n * Baseclass for all Managers.\n * \n * In order for a new Manager to be added to the engine, it must inherit\n * this class and define these functions to be recognized by the Engine.\n * \n * TODO: Finish Plugins in Engine Manager & implement optional function calls on updateables.\n ",
"start": 0,
"end": 286,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 8,
"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": 288,
"end": 294,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"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": 295,
"end": 302,
"loc": {
"start": {
"line": 10,
"column": 7
},
"end": {
"line": 10,
"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": 303,
"end": 308,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 20
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "Manager",
"start": 309,
"end": 316,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 28
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 317,
"end": 318,
"loc": {
"start": {
"line": 10,
"column": 29
},
"end": {
"line": 10,
"column": 30
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "constructor",
"start": 323,
"end": 334,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 15
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 334,
"end": 335,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 16
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 335,
"end": 336,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 17
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 337,
"end": 338,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 11,
"column": 19
}
}
},
{
"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": 13,
"column": 4
},
"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": "start",
"start": 355,
"end": 360,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 360,
"end": 361,
"loc": {
"start": {
"line": 15,
"column": 9
},
"end": {
"line": 15,
"column": 10
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 361,
"end": 362,
"loc": {
"start": {
"line": 15,
"column": 10
},
"end": {
"line": 15,
"column": 11
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 363,
"end": 364,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 13
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 364,
"end": 365,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "update",
"start": 370,
"end": 376,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 10
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 376,
"end": 377,
"loc": {
"start": {
"line": 16,
"column": 10
},
"end": {
"line": 16,
"column": 11
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 377,
"end": 378,
"loc": {
"start": {
"line": 16,
"column": 11
},
"end": {
"line": 16,
"column": 12
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 379,
"end": 380,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 14
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 380,
"end": 381,
"loc": {
"start": {
"line": 16,
"column": 14
},
"end": {
"line": 16,
"column": 15
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "end",
"start": 386,
"end": 389,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 7
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 389,
"end": 390,
"loc": {
"start": {
"line": 17,
"column": 7
},
"end": {
"line": 17,
"column": 8
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 390,
"end": 391,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 9
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 392,
"end": 393,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 11
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 393,
"end": 394,
"loc": {
"start": {
"line": 17,
"column": 11
},
"end": {
"line": 17,
"column": 12
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "pause",
"start": 399,
"end": 404,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 9
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 404,
"end": 405,
"loc": {
"start": {
"line": 18,
"column": 9
},
"end": {
"line": 18,
"column": 10
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 405,
"end": 406,
"loc": {
"start": {
"line": 18,
"column": 10
},
"end": {
"line": 18,
"column": 11
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 407,
"end": 408,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 13
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 408,
"end": 409,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "unpause",
"start": 414,
"end": 421,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 11
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 421,
"end": 422,
"loc": {
"start": {
"line": 19,
"column": 11
},
"end": {
"line": 19,
"column": 12
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 422,
"end": 423,
"loc": {
"start": {
"line": 19,
"column": 12
},
"end": {
"line": 19,
"column": 13
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 424,
"end": 425,
"loc": {
"start": {
"line": 19,
"column": 14
},
"end": {
"line": 19,
"column": 15
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 425,
"end": 426,
"loc": {
"start": {
"line": 19,
"column": 15
},
"end": {
"line": 19,
"column": 16
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 427,
"end": 428,
"loc": {
"start": {
"line": 20,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
}
},
{
"type": {
"label": "eof",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 428,
"end": 428,
"loc": {
"start": {
"line": 20,
"column": 1
},
"end": {
"line": 20,
"column": 1
}
}
}
]
}