oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,666 lines (1,665 loc) • 2.58 MB
JSON
{
"type": "File",
"start": 0,
"end": 11874,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 392,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 11874,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 392,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 58,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 58
}
},
"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": 57,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 57
}
},
"extra": {
"rawValue": "../systems/EntitySystem/Component",
"raw": "'../systems/EntitySystem/Component'"
},
"value": "../systems/EntitySystem/Component"
}
},
{
"type": "ImportDeclaration",
"start": 60,
"end": 99,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 39
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 67,
"end": 73,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 67,
"end": 73,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 13
},
"identifierName": "System"
},
"name": "System"
}
}
],
"source": {
"type": "StringLiteral",
"start": 79,
"end": 98,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 38
}
},
"extra": {
"rawValue": "../systems/System",
"raw": "'../systems/System'"
},
"value": "../systems/System"
}
},
{
"type": "ImportDeclaration",
"start": 101,
"end": 147,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 46
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 110,
"end": 128,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 27
}
},
"imported": {
"type": "Identifier",
"start": 110,
"end": 128,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 27
},
"identifierName": "propsEnumStringify"
},
"name": "propsEnumStringify"
},
"local": {
"type": "Identifier",
"start": 110,
"end": 128,
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 27
},
"identifierName": "propsEnumStringify"
},
"name": "propsEnumStringify"
}
}
],
"source": {
"type": "StringLiteral",
"start": 136,
"end": 146,
"loc": {
"start": {
"line": 3,
"column": 35
},
"end": {
"line": 3,
"column": 45
}
},
"extra": {
"rawValue": "../utils",
"raw": "'../utils'"
},
"value": "../utils"
}
},
{
"type": "VariableDeclaration",
"start": 151,
"end": 505,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 20,
"column": 2
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 157,
"end": 504,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 20,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 157,
"end": 167,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 16
},
"identifierName": "EventFlags"
},
"name": "EventFlags"
},
"init": {
"type": "ObjectExpression",
"start": 170,
"end": 504,
"loc": {
"start": {
"line": 5,
"column": 19
},
"end": {
"line": 20,
"column": 1
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 175,
"end": 182,
"loc": {
"start": {
"line": 6,
"column": 2
},
"end": {
"line": 6,
"column": 9
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 175,
"end": 179,
"loc": {
"start": {
"line": 6,
"column": 2
},
"end": {
"line": 6,
"column": 6
},
"identifierName": "NONE"
},
"name": "NONE"
},
"value": {
"type": "NumericLiteral",
"start": 181,
"end": 182,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 9
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
},
{
"type": "ObjectProperty",
"start": 187,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 20
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 187,
"end": 197,
"loc": {
"start": {
"line": 7,
"column": 2
},
"end": {
"line": 7,
"column": 12
},
"identifierName": "MOUSE_DOWN"
},
"name": "MOUSE_DOWN"
},
"value": {
"type": "BinaryExpression",
"start": 199,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 20
}
},
"left": {
"type": "NumericLiteral",
"start": 199,
"end": 200,
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 15
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 204,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 19
},
"end": {
"line": 7,
"column": 20
}
},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
}
},
{
"type": "ObjectProperty",
"start": 210,
"end": 226,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 18
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 210,
"end": 218,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 10
},
"identifierName": "MOUSE_UP"
},
"name": "MOUSE_UP"
},
"value": {
"type": "BinaryExpression",
"start": 220,
"end": 226,
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 18
}
},
"left": {
"type": "NumericLiteral",
"start": 220,
"end": 221,
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 13
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 225,
"end": 226,
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 18
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
}
},
{
"type": "ObjectProperty",
"start": 231,
"end": 249,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 20
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 231,
"end": 241,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 12
},
"identifierName": "MOUSE_MOVE"
},
"name": "MOUSE_MOVE"
},
"value": {
"type": "BinaryExpression",
"start": 243,
"end": 249,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 20
}
},
"left": {
"type": "NumericLiteral",
"start": 243,
"end": 244,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 15
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 248,
"end": 249,
"loc": {
"start": {
"line": 9,
"column": 19
},
"end": {
"line": 9,
"column": 20
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
},
{
"type": "ObjectProperty",
"start": 254,
"end": 270,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 10,
"column": 18
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 254,
"end": 262,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 10,
"column": 10
},
"identifierName": "KEY_DOWN"
},
"name": "KEY_DOWN"
},
"value": {
"type": "BinaryExpression",
"start": 264,
"end": 270,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 18
}
},
"left": {
"type": "NumericLiteral",
"start": 264,
"end": 265,
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 13
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 269,
"end": 270,
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 18
}
},
"extra": {
"rawValue": 3,
"raw": "3"
},
"value": 3
}
}
},
{
"type": "ObjectProperty",
"start": 275,
"end": 289,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 11,
"column": 16
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 275,
"end": 281,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 11,
"column": 8
},
"identifierName": "KEY_UP"
},
"name": "KEY_UP"
},
"value": {
"type": "BinaryExpression",
"start": 283,
"end": 289,
"loc": {
"start": {
"line": 11,
"column": 10
},
"end": {
"line": 11,
"column": 16
}
},
"left": {
"type": "NumericLiteral",
"start": 283,
"end": 284,
"loc": {
"start": {
"line": 11,
"column": 10
},
"end": {
"line": 11,
"column": 11
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 288,
"end": 289,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 16
}
},
"extra": {
"rawValue": 4,
"raw": "4"
},
"value": 4
}
}
},
{
"type": "ObjectProperty",
"start": 294,
"end": 319,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 294,
"end": 311,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 19
},
"identifierName": "GAMEPAD_CONNECTED"
},
"name": "GAMEPAD_CONNECTED"
},
"value": {
"type": "BinaryExpression",
"start": 313,
"end": 319,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 27
}
},
"left": {
"type": "NumericLiteral",
"start": 313,
"end": 314,
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 22
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 318,
"end": 319,
"loc": {
"start": {
"line": 12,
"column": 26
},
"end": {
"line": 12,
"column": 27
}
},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
}
},
{
"type": "ObjectProperty",
"start": 324,
"end": 352,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 30
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 324,
"end": 344,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 22
},
"identifierName": "GAMEPAD_DISCONNECTED"
},
"name": "GAMEPAD_DISCONNECTED"
},
"value": {
"type": "BinaryExpression",
"start": 346,
"end": 352,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 30
}
},
"left": {
"type": "NumericLiteral",
"start": 346,
"end": 347,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 25
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 351,
"end": 352,
"loc": {
"start": {
"line": 13,
"column": 29
},
"end": {
"line": 13,
"column": 30
}
},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
},
{
"type": "ObjectProperty",
"start": 357,
"end": 380,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 357,
"end": 372,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 17
},
"identifierName": "GAMEPAD_PROCESS"
},
"name": "GAMEPAD_PROCESS"
},
"value": {
"type": "BinaryExpression",
"start": 374,
"end": 380,
"loc": {
"start": {
"line": 14,
"column": 19
},
"end": {
"line": 14,
"column": 25
}
},
"left": {
"type": "NumericLiteral",
"start": 374,
"end": 375,
"loc": {
"start": {
"line": 14,
"column": 19
},
"end": {
"line": 14,
"column": 20
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 379,
"end": 380,
"loc": {
"start": {
"line": 14,
"column": 24
},
"end": {
"line": 14,
"column": 25
}
},
"extra": {
"rawValue": 7,
"raw": "7"
},
"value": 7
}
}
},
{
"type": "ObjectProperty",
"start": 385,
"end": 406,
"loc": {
"start": {
"line": 15,
"column": 2
},
"end": {
"line": 15,
"column": 23
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 385,
"end": 398,
"loc": {
"start": {
"line": 15,
"column": 2
},
"end": {
"line": 15,
"column": 15
},
"identifierName": "CONTACT_BEGIN"
},
"name": "CONTACT_BEGIN"
},
"value": {
"type": "BinaryExpression",
"start": 400,
"end": 406,
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 23
}
},
"left": {
"type": "NumericLiteral",
"start": 400,
"end": 401,
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 18
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 405,
"end": 406,
"loc": {
"start": {
"line": 15,
"column": 22
},
"end": {
"line": 15,
"column": 23
}
},
"extra": {
"rawValue": 8,
"raw": "8"
},
"value": 8
}
}
},
{
"type": "ObjectProperty",
"start": 411,
"end": 430,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 21
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 411,
"end": 422,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 13
},
"identifierName": "CONTACT_END"
},
"name": "CONTACT_END"
},
"value": {
"type": "BinaryExpression",
"start": 424,
"end": 430,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 21
}
},
"left": {
"type": "NumericLiteral",
"start": 424,
"end": 425,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 16
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 429,
"end": 430,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 21
}
},
"extra": {
"rawValue": 9,
"raw": "9"
},
"value": 9
}
}
},
{
"type": "ObjectProperty",
"start": 435,
"end": 454,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 21
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 435,
"end": 445,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 12
},
"identifierName": "TOUCH_DOWN"
},
"name": "TOUCH_DOWN"
},
"value": {
"type": "BinaryExpression",
"start": 447,
"end": 454,
"loc": {
"start": {
"line": 17,
"column": 14
},
"end": {
"line": 17,
"column": 21
}
},
"left": {
"type": "NumericLiteral",
"start": 447,
"end": 448,
"loc": {
"start": {
"line": 17,
"column": 14
},
"end": {
"line": 17,
"column": 15
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 452,
"end": 454,
"loc": {
"start": {
"line": 17,
"column": 19
},
"end": {
"line": 17,
"column": 21
}
},
"extra": {
"rawValue": 10,
"raw": "10"
},
"value": 10
}
}
},
{
"type": "ObjectProperty",
"start": 459,
"end": 476,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 19
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 459,
"end": 467,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 10
},
"identifierName": "TOUCH_UP"
},
"name": "TOUCH_UP"
},
"value": {
"type": "BinaryExpression",
"start": 469,
"end": 476,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 19
}
},
"left": {
"type": "NumericLiteral",
"start": 469,
"end": 470,
"loc": {
"start": {
"line": 18,
"column": 12
},
"end": {
"line": 18,
"column": 13
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 474,
"end": 476,
"loc": {
"start": {
"line": 18,
"column": 17
},
"end": {
"line": 18,
"column": 19
}
},
"extra": {
"rawValue": 11,
"raw": "11"
},
"value": 11
}
}
},
{
"type": "ObjectProperty",
"start": 481,
"end": 500,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 21
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 481,
"end": 491,
"loc": {
"start": {
"line": 19,
"column": 2
},
"end": {
"line": 19,
"column": 12
},
"identifierName": "TOUCH_MOVE"
},
"name": "TOUCH_MOVE"
},
"value": {
"type": "BinaryExpression",
"start": 493,
"end": 500,
"loc": {
"start": {
"line": 19,
"column": 14
},
"end": {
"line": 19,
"column": 21
}
},
"left": {
"type": "NumericLiteral",
"start": 493,
"end": 494,
"loc": {
"start": {
"line": 19,
"column": 14
},
"end": {
"line": 19,
"column": 15
}
},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
},
"operator": "<<",
"right": {
"type": "NumericLiteral",
"start": 498,
"end": 500,
"loc": {
"start": {
"line": 19,
"column": 19
},
"end": {
"line": 19,
"column": 21
}
},
"extra": {
"rawValue": 12,
"raw": "12"
},
"value": 12
}
}
}
]
}
}
],
"kind": "const"
},
{
"type": "ExpressionStatement",
"start": 507,
"end": 594,
"loc": {
"start": {
"line": 21,
"column": 0
},
"end": {
"line": 21,
"column": 87
}
},
"expression": {
"type": "AssignmentExpression",
"start": 507,
"end": 593,
"loc": {
"start": {
"line": 21,
"column": 0
},
"end": {
"line": 21,
"column": 86
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 507,
"end": 523,
"loc": {
"start": {
"line": 21,
"column": 0
},
"end": {
"line": 21,
"column": 16
}
},
"object": {
"type": "Identifier",
"start": 507,
"end": 517,
"loc": {
"start": {
"line": 21,
"column": 0
},
"end": {
"line": 21,
"column": 10
},
"identifierName": "EventFlags"
},
"name": "EventFlags"
},
"property": {
"type": "Identifier",
"start": 518,
"end": 523,
"loc": {
"start": {
"line": 21,
"column": 11
},
"end": {
"line": 21,
"column": 16
},
"identifierName": "MOUSE"
},
"name": "MOUSE"
},
"computed": false
},
"right": {
"type": "BinaryExpression",
"start": 526,
"end": 593,
"loc": {
"start": {
"line": 21,
"column": 19
},
"end": {
"line": 21,
"column": 86
}
},
"left": {
"type": "BinaryExpression",
"start": 526,
"end": 569,
"loc": {
"start": {
"line": 21,
"column": 19
},
"end": {
"line": 21,
"column": 62
}