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,327 lines (1,326 loc) • 208 kB
JSON
{
"type": "File",
"start": 0,
"end": 1441,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 54,
"column": 25
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1441,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 54,
"column": 25
}
},
"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": "ImportDeclaration",
"start": 33,
"end": 75,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 42
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 42,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 23
}
},
"imported": {
"type": "Identifier",
"start": 42,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 23
},
"identifierName": "TextureManager"
},
"name": "TextureManager"
},
"local": {
"type": "Identifier",
"start": 42,
"end": 56,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 23
},
"identifierName": "TextureManager"
},
"name": "TextureManager"
}
}
],
"source": {
"type": "StringLiteral",
"start": 64,
"end": 74,
"loc": {
"start": {
"line": 2,
"column": 31
},
"end": {
"line": 2,
"column": 41
}
},
"extra": {
"rawValue": "../entry",
"raw": "'../entry'"
},
"value": "../entry"
}
},
{
"type": "ExportNamedDeclaration",
"start": 77,
"end": 1329,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 48,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "ClassDeclaration",
"start": 84,
"end": 1329,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 48,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 90,
"end": 100,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 23
},
"identifierName": "_UIManager"
},
"name": "_UIManager"
},
"superClass": {
"type": "Identifier",
"start": 109,
"end": 116,
"loc": {
"start": {
"line": 4,
"column": 32
},
"end": {
"line": 4,
"column": 39
},
"identifierName": "Manager"
},
"name": "Manager"
},
"body": {
"type": "ClassBody",
"start": 117,
"end": 1329,
"loc": {
"start": {
"line": 4,
"column": 40
},
"end": {
"line": 48,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 123,
"end": 705,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 21,
"column": 5
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 123,
"end": 134,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 137,
"end": 705,
"loc": {
"start": {
"line": 5,
"column": 18
},
"end": {
"line": 21,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 147,
"end": 155,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 16
}
},
"expression": {
"type": "CallExpression",
"start": 147,
"end": 154,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 15
}
},
"callee": {
"type": "Super",
"start": 147,
"end": 152,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 13
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 165,
"end": 560,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 16,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 165,
"end": 559,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 16,
"column": 9
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 165,
"end": 182,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 165,
"end": 169,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 170,
"end": 182,
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 25
},
"identifierName": "defaultStyle"
},
"name": "defaultStyle"
},
"computed": false
},
"right": {
"type": "ObjectExpression",
"start": 185,
"end": 559,
"loc": {
"start": {
"line": 8,
"column": 28
},
"end": {
"line": 16,
"column": 9
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 199,
"end": 258,
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 71
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 199,
"end": 212,
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 25
},
"identifierName": "buttonTexture"
},
"name": "buttonTexture"
},
"value": {
"type": "CallExpression",
"start": 214,
"end": 258,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 71
}
},
"callee": {
"type": "MemberExpression",
"start": 214,
"end": 239,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 52
}
},
"object": {
"type": "Identifier",
"start": 214,
"end": 228,
"loc": {
"start": {
"line": 9,
"column": 27
},
"end": {
"line": 9,
"column": 41
},
"identifierName": "TextureManager"
},
"name": "TextureManager"
},
"property": {
"type": "Identifier",
"start": 229,
"end": 239,
"loc": {
"start": {
"line": 9,
"column": 42
},
"end": {
"line": 9,
"column": 52
},
"identifierName": "getTexture"
},
"name": "getTexture"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 240,
"end": 257,
"loc": {
"start": {
"line": 9,
"column": 53
},
"end": {
"line": 9,
"column": 70
}
},
"extra": {
"rawValue": "uiButtonDefault",
"raw": "'uiButtonDefault'"
},
"value": "uiButtonDefault"
}
]
}
},
{
"type": "ObjectProperty",
"start": 272,
"end": 289,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 29
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 272,
"end": 286,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 26
},
"identifierName": "buttonSubImage"
},
"name": "buttonSubImage"
},
"value": {
"type": "NumericLiteral",
"start": 288,
"end": 289,
"loc": {
"start": {
"line": 10,
"column": 28
},
"end": {
"line": 10,
"column": 29
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
},
{
"type": "ObjectProperty",
"start": 303,
"end": 325,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 34
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 303,
"end": 322,
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 31
},
"identifierName": "buttonHoverSubImage"
},
"name": "buttonHoverSubImage"
},
"value": {
"type": "NumericLiteral",
"start": 324,
"end": 325,
"loc": {
"start": {
"line": 11,
"column": 33
},
"end": {
"line": 11,
"column": 34
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
},
{
"type": "ObjectProperty",
"start": 339,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 36
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 339,
"end": 360,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 33
},
"identifierName": "buttonPressedSubImage"
},
"name": "buttonPressedSubImage"
},
"value": {
"type": "NumericLiteral",
"start": 362,
"end": 363,
"loc": {
"start": {
"line": 12,
"column": 35
},
"end": {
"line": 12,
"column": 36
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
{
"type": "ObjectProperty",
"start": 377,
"end": 402,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 37
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 377,
"end": 399,
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 34
},
"identifierName": "buttonReleasedSubImage"
},
"name": "buttonReleasedSubImage"
},
"value": {
"type": "NumericLiteral",
"start": 401,
"end": 402,
"loc": {
"start": {
"line": 13,
"column": 36
},
"end": {
"line": 13,
"column": 37
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
},
{
"type": "ObjectProperty",
"start": 416,
"end": 469,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 65
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 416,
"end": 427,
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 23
},
"identifierName": "fontTexture"
},
"name": "fontTexture"
},
"value": {
"type": "CallExpression",
"start": 429,
"end": 469,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 65
}
},
"callee": {
"type": "MemberExpression",
"start": 429,
"end": 454,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 50
}
},
"object": {
"type": "Identifier",
"start": 429,
"end": 443,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 39
},
"identifierName": "TextureManager"
},
"name": "TextureManager"
},
"property": {
"type": "Identifier",
"start": 444,
"end": 454,
"loc": {
"start": {
"line": 14,
"column": 40
},
"end": {
"line": 14,
"column": 50
},
"identifierName": "getTexture"
},
"name": "getTexture"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 455,
"end": 468,
"loc": {
"start": {
"line": 14,
"column": 51
},
"end": {
"line": 14,
"column": 64
}
},
"extra": {
"rawValue": "fontDefault",
"raw": "'fontDefault'"
},
"value": "fontDefault"
}
]
}
},
{
"type": "ObjectProperty",
"start": 483,
"end": 548,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 77
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 483,
"end": 502,
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 31
},
"identifierName": "textInputBoxTexture"
},
"name": "textInputBoxTexture"
},
"value": {
"type": "CallExpression",
"start": 504,
"end": 548,
"loc": {
"start": {
"line": 15,
"column": 33
},
"end": {
"line": 15,
"column": 77
}
},
"callee": {
"type": "MemberExpression",
"start": 504,
"end": 529,
"loc": {
"start": {
"line": 15,
"column": 33
},
"end": {
"line": 15,
"column": 58
}
},
"object": {
"type": "Identifier",
"start": 504,
"end": 518,
"loc": {
"start": {
"line": 15,
"column": 33
},
"end": {
"line": 15,
"column": 47
},
"identifierName": "TextureManager"
},
"name": "TextureManager"
},
"property": {
"type": "Identifier",
"start": 519,
"end": 529,
"loc": {
"start": {
"line": 15,
"column": 48
},
"end": {
"line": 15,
"column": 58
},
"identifierName": "getTexture"
},
"name": "getTexture"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 530,
"end": 547,
"loc": {
"start": {
"line": 15,
"column": 59
},
"end": {
"line": 15,
"column": 76
}
},
"extra": {
"rawValue": "uiButtonDefault",
"raw": "'uiButtonDefault'"
},
"value": "uiButtonDefault"
}
]
}
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 569,
"end": 586,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 25
}
},
"expression": {
"type": "AssignmentExpression",
"start": 569,
"end": 585,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 24
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 569,
"end": 580,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 19
}
},
"object": {
"type": "ThisExpression",
"start": 569,
"end": 573,
"loc": {
"start": {
"line": 17,
"column": 8
},
"end": {
"line": 17,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 574,
"end": 580,
"loc": {
"start": {
"line": 17,
"column": 13
},
"end": {
"line": 17,
"column": 19
},
"identifierName": "styles"
},
"name": "styles"
},
"computed": false
},
"right": {
"type": "ArrayExpression",
"start": 583,
"end": 585,
"loc": {
"start": {
"line": 17,
"column": 22
},
"end": {
"line": 17,
"column": 24
}
},
"elements": []
}
}
},
{
"type": "ExpressionStatement",
"start": 595,
"end": 620,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 33
}
},
"expression": {
"type": "AssignmentExpression",
"start": 595,
"end": 619,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 32
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 595,
"end": 612,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 25
}
},
"object": {
"type": "ThisExpression",
"start": 595,
"end": 599,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 600,
"end": 612,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 25
},
"identifierName": "currentStyle"
},
"name": "currentStyle"
},
"computed": false
},
"right": {
"type": "NullLiteral",
"start": 615,
"end": 619,
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 32
}
}
}
}
},
{
"type": "ExpressionStatement",
"start": 629,
"end": 658,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 37
}
},
"expression": {
"type": "CallExpression",
"start": 629,
"end": 657,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 629,
"end": 642,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 21
}
},
"object": {
"type": "ThisExpression",
"start": 629,
"end": 633,
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 634,
"end": 642,
"loc": {
"start": {
"line": 19,
"column": 13
},
"end": {
"line": 19,
"column": 21
},
"identifierName": "addStyle"
},
"name": "addStyle"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 643,
"end": 652,
"loc": {
"start": {
"line": 19,
"column": 22
},
"end": {
"line": 19,
"column": 31
}
},