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,432 lines • 31.9 kB
JSON
{
"type": "File",
"start": 0,
"end": 452,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 14,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 452,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 14,
"column": 1
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "Component"
},
"name": "Component"
}
}
],
"source": {
"type": "StringLiteral",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
},
"extra": {
"rawValue": "./Component",
"raw": "'./Component'"
},
"value": "./Component"
}
},
{
"type": "ImportDeclaration",
"start": 37,
"end": 76,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 39
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 44,
"end": 51,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 44,
"end": 51,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "KeyCode"
},
"name": "KeyCode"
}
}
],
"source": {
"type": "StringLiteral",
"start": 57,
"end": 75,
"loc": {
"start": {
"line": 2,
"column": 20
},
"end": {
"line": 2,
"column": 38
}
},
"extra": {
"rawValue": "../const/KeyCode",
"raw": "'../const/KeyCode'"
},
"value": "../const/KeyCode"
}
},
{
"type": "ImportDeclaration",
"start": 77,
"end": 128,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 51
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 84,
"end": 96,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
}
},
"local": {
"type": "Identifier",
"start": 84,
"end": 96,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
},
"identifierName": "InputManager"
},
"name": "InputManager"
}
}
],
"source": {
"type": "StringLiteral",
"start": 102,
"end": 127,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 50
}
},
"extra": {
"rawValue": "../manager/InputManager",
"raw": "'../manager/InputManager'"
},
"value": "../manager/InputManager"
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * A Baseclass for controller components. It is advised to use\n * controllers to contain movement logic. There are basic movement and \n * onClick controllers. You may make your own, remember to derive this class.\n ",
"start": 130,
"end": 350,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 351,
"end": 452,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 14,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 366,
"end": 452,
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 14,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 372,
"end": 382,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 31
},
"identifierName": "Controller"
},
"name": "Controller",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 391,
"end": 400,
"loc": {
"start": {
"line": 10,
"column": 40
},
"end": {
"line": 10,
"column": 49
},
"identifierName": "Component"
},
"name": "Component"
},
"body": {
"type": "ClassBody",
"start": 401,
"end": 452,
"loc": {
"start": {
"line": 10,
"column": 50
},
"end": {
"line": 14,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 407,
"end": 450,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 407,
"end": 418,
"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": 421,
"end": 450,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 13,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 431,
"end": 444,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 21
}
},
"expression": {
"type": "CallExpression",
"start": 431,
"end": 443,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 20
}
},
"callee": {
"type": "Super",
"start": 431,
"end": 436,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 13
}
}
},
"arguments": [
{
"type": "BooleanLiteral",
"start": 437,
"end": 442,
"loc": {
"start": {
"line": 12,
"column": 14
},
"end": {
"line": 12,
"column": 19
}
},
"value": false
}
]
}
}
],
"directives": []
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * A Baseclass for controller components. It is advised to use\n * controllers to contain movement logic. There are basic movement and \n * onClick controllers. You may make your own, remember to derive this class.\n ",
"start": 130,
"end": 350,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
}
],
"trailingComments": []
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * A Baseclass for controller components. It is advised to use\n * controllers to contain movement logic. There are basic movement and \n * onClick controllers. You may make your own, remember to derive this class.\n ",
"start": 130,
"end": 350,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
}
]
}
],
"directives": []
},
"comments": [
{
"type": "CommentBlock",
"value": "*\n * A Baseclass for controller components. It is advised to use\n * controllers to contain movement logic. There are basic movement and \n * onClick controllers. You may make your own, remember to derive this class.\n ",
"start": 130,
"end": 350,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 9,
"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": "Component",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "from",
"start": 17,
"end": 21,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 21
}
}
},
{
"type": {
"label": "string",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "./Component",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 35,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 35
},
"end": {
"line": 1,
"column": 36
}
}
},
{
"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": 37,
"end": 43,
"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": "KeyCode",
"start": 44,
"end": 51,
"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": 52,
"end": 56,
"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": "../const/KeyCode",
"start": 57,
"end": 75,
"loc": {
"start": {
"line": 2,
"column": 20
},
"end": {
"line": 2,
"column": 38
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 75,
"end": 76,
"loc": {
"start": {
"line": 2,
"column": 38
},
"end": {
"line": 2,
"column": 39
}
}
},
{
"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": 77,
"end": 83,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 6
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "InputManager",
"start": 84,
"end": 96,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "from",
"start": 97,
"end": 101,
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 24
}
}
},
{
"type": {
"label": "string",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "../manager/InputManager",
"start": 102,
"end": 127,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 50
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 127,
"end": 128,
"loc": {
"start": {
"line": 3,
"column": 50
},
"end": {
"line": 3,
"column": 51
}
}
},
{
"type": "CommentBlock",
"value": "*\n * A Baseclass for controller components. It is advised to use\n * controllers to contain movement logic. There are basic movement and \n * onClick controllers. You may make your own, remember to derive this class.\n ",
"start": 130,
"end": 350,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 9,
"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": 351,
"end": 357,
"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": 358,
"end": 365,
"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": 366,
"end": 371,
"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": "Controller",
"start": 372,
"end": 382,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 31
}
}
},
{
"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": 383,
"end": 390,
"loc": {
"start": {
"line": 10,
"column": 32
},
"end": {
"line": 10,
"column": 39
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "Component",
"start": 391,
"end": 400,
"loc": {
"start": {
"line": 10,
"column": 40
},
"end": {
"line": 10,
"column": 49
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 401,
"end": 402,
"loc": {
"start": {
"line": 10,
"column": 50
},
"end": {
"line": 10,
"column": 51
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "constructor",
"start": 407,
"end": 418,
"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": 418,
"end": 419,
"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": 419,
"end": 420,
"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": 421,
"end": 422,
"loc": {
"start": {
"line": 11,
"column": 18
},
"end": {
"line": 11,
"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": 431,
"end": 436,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 13
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 436,
"end": 437,
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 14
}
}
},
{
"type": {
"label": "false",
"keyword": "false",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "false",
"start": 437,
"end": 442,
"loc": {
"start": {
"line": 12,
"column": 14
},
"end": {
"line": 12,
"column": 19
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 442,
"end": 443,
"loc": {
"start": {
"line": 12,
"column": 19
},
"end": {
"line": 12,
"column": 20
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 443,
"end": 444,
"loc": {
"start": {
"line": 12,
"column": 20
},
"end": {
"line": 12,
"column": 21
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 449,
"end": 450,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 5
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 451,
"end": 452,
"loc": {
"start": {
"line": 14,
"column": 0
},
"end": {
"line": 14,
"column": 1
}
}
},
{
"type": {
"label": "eof",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 452,
"end": 452,
"loc": {
"start": {
"line": 14,
"column": 1
},
"end": {
"line": 14,
"column": 1
}
}
}
]
}