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,377 lines • 553 kB
JSON
[
{
"__docId__": 1,
"kind": "external",
"name": "Infinity",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Infinity",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 2,
"kind": "external",
"name": "NaN",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~NaN",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 3,
"kind": "external",
"name": "undefined",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~undefined",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 4,
"kind": "external",
"name": "null",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~null",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 5,
"kind": "external",
"name": "Object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 6,
"kind": "external",
"name": "object",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~object",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 7,
"kind": "external",
"name": "Function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 8,
"kind": "external",
"name": "function",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~function",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 9,
"kind": "external",
"name": "Boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 10,
"kind": "external",
"name": "boolean",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~boolean",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 11,
"kind": "external",
"name": "Symbol",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Symbol",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 12,
"kind": "external",
"name": "Error",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Error",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 13,
"kind": "external",
"name": "EvalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~EvalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 14,
"kind": "external",
"name": "InternalError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~InternalError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 15,
"kind": "external",
"name": "RangeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RangeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 16,
"kind": "external",
"name": "ReferenceError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ReferenceError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 17,
"kind": "external",
"name": "SyntaxError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~SyntaxError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 18,
"kind": "external",
"name": "TypeError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~TypeError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 19,
"kind": "external",
"name": "URIError",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~URIError",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 20,
"kind": "external",
"name": "Number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 21,
"kind": "external",
"name": "number",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~number",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 22,
"kind": "external",
"name": "Date",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Date",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 23,
"kind": "external",
"name": "String",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~String",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 24,
"kind": "external",
"name": "string",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~string",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 25,
"kind": "external",
"name": "RegExp",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~RegExp",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 26,
"kind": "external",
"name": "Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 27,
"kind": "external",
"name": "Int8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 28,
"kind": "external",
"name": "Uint8Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 29,
"kind": "external",
"name": "Uint8ClampedArray",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint8ClampedArray",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 30,
"kind": "external",
"name": "Int16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 31,
"kind": "external",
"name": "Uint16Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint16Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 32,
"kind": "external",
"name": "Int32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Int32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 33,
"kind": "external",
"name": "Uint32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Uint32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 34,
"kind": "external",
"name": "Float32Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float32Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 35,
"kind": "external",
"name": "Float64Array",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Float64Array",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 36,
"kind": "external",
"name": "Map",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Map",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 37,
"kind": "external",
"name": "Set",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Set",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 38,
"kind": "external",
"name": "WeakMap",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakMap",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 39,
"kind": "external",
"name": "WeakSet",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~WeakSet",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 40,
"kind": "external",
"name": "ArrayBuffer",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~ArrayBuffer",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 41,
"kind": "external",
"name": "DataView",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~DataView",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 42,
"kind": "external",
"name": "JSON",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~JSON",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 43,
"kind": "external",
"name": "Promise",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Promise",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 44,
"kind": "external",
"name": "Generator",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Generator",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 45,
"kind": "external",
"name": "GeneratorFunction",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~GeneratorFunction",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 46,
"kind": "external",
"name": "Reflect",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Reflect",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 47,
"kind": "external",
"name": "Proxy",
"externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
"memberof": "src/.external-ecmascript.js",
"static": true,
"longname": "src/.external-ecmascript.js~Proxy",
"access": "public",
"description": "",
"builtinExternal": true
},
{
"__docId__": 48,
"kind": "file",
"name": "src/Engine.js",
"content": "'use-strict';\n\nimport EngineManager from './manager/EngineManager';\nimport Manager from './manager/Manager';\n\n/**\n * Engine Singleton class. Entry point reference to access managers and\n * to start and stop the Engine.\n */\nexport class _Engine {\n /**\n * Engine Contstructor.\n */\n constructor() {\n }\n\n /**\n * Starts the engine.\n */\n start() {\n EngineManager.start();\n }\n\n /**\n * Stops the engine and cleans up code.\n */\n end() {\n EngineManager.end();\n }\n\n /**\n * Pauses the entire engine.\n */\n pause() {\n EngineManager.pause();\n }\n\n /**\n * Resumes to the Engine.\n */\n unpause() {\n EngineManager.unpause();\n }\n}\n\n/**\n * Singleton reference to the Engine.\n */\nconst Engine = new _Engine();\nexport default Engine;",
"static": true,
"longname": "/Users/jaegarsarauer/Documents/DATA/CajartyComputing/Seed/SeedGameEngine/src/Engine.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 49,
"kind": "class",
"name": "_Engine",
"memberof": "src/Engine.js",
"static": true,
"longname": "src/Engine.js~_Engine",
"access": "private",
"export": true,
"importPath": "seed-engine/src/Engine.js",
"importStyle": "{_Engine}",
"description": "Engine Singleton class. Entry point reference to access managers and\nto start and stop the Engine.",
"lineNumber": 10,
"interface": false
},
{
"__docId__": 50,
"kind": "constructor",
"name": "constructor",
"memberof": "src/Engine.js~_Engine",
"generator": false,
"async": false,
"static": false,
"longname": "src/Engine.js~_Engine#constructor",
"access": "public",
"description": "Engine Contstructor.",
"lineNumber": 14
},
{
"__docId__": 51,
"kind": "method",
"name": "start",
"memberof": "src/Engine.js~_Engine",
"generator": false,
"async": false,
"static": false,
"longname": "src/Engine.js~_Engine#start",
"access": "public",
"description": "Starts the engine.",
"lineNumber": 20,
"params": [],
"return": null
},
{
"__docId__": 52,
"kind": "method",
"name": "end",
"memberof": "src/Engine.js~_Engine",
"generator": false,
"async": false,
"static": false,
"longname": "src/Engine.js~_Engine#end",
"access": "public",
"description": "Stops the engine and cleans up code.",
"lineNumber": 27,
"params": [],
"return": null
},
{
"__docId__": 53,
"kind": "method",
"name": "pause",
"memberof": "src/Engine.js~_Engine",
"generator": false,
"async": false,
"static": false,
"longname": "src/Engine.js~_Engine#pause",
"access": "public",
"description": "Pauses the entire engine.",
"lineNumber": 34,
"params": [],
"return": null
},
{
"__docId__": 54,
"kind": "method",
"name": "unpause",
"memberof": "src/Engine.js~_Engine",
"generator": false,
"async": false,
"static": false,
"longname": "src/Engine.js~_Engine#unpause",
"access": "public",
"description": "Resumes to the Engine.",
"lineNumber": 41,
"params": [],
"return": null
},
{
"__docId__": 55,
"kind": "variable",
"name": "Engine",
"memberof": "src/Engine.js",
"static": true,
"longname": "src/Engine.js~Engine",
"access": "public",
"export": true,
"importPath": "seed-engine/src/Engine.js",
"importStyle": "Engine",
"description": null,
"lineNumber": 50,
"undocument": true,
"type": {
"types": [
"src/Engine.js~_Engine"
]
}
},
{
"__docId__": 56,
"kind": "file",
"name": "src/base/Updateable.js",
"content": "import UpdateableManager from '../manager/UpdateableManager';\n\n/**\n * Baseclass for objects that follow the same ECS pattern of the seed engine.\n * \n * Used in anything that should follow a create, update, end loop \n * handled by the Engine.\n * \n * Many things will need to update/start/end. If you derive something that\n * has the start()/update()/end()... functions, the children should fill in\n * their respective callbacks (onStart()/onUpdate()/onEnd()/...).\n */\nexport default class Updateable {\n constructor() {\n this.hasStarted = false;\n this.hasPaused = false;\n this.id = -1;\n this.deregister = UpdateableManager.registerUpdateable(this);\n }\n\n /**\n * Base call function for when this Updateable is to be started.\n */\n start() {\n this.onStart();\n this.hasStarted = true;\n }\n\n /**\n * Base call function for when this Updateable is to be updated.\n */\n update() {\n if (this.hasPaused)\n return;\n \n if (!this.hasStarted) {\n this.start();\n return;\n }\n\n this.onUpdate();\n }\n\n /**\n * Base call function for when this Updateable is to be ended.\n */\n end() {\n this.onEnd();\n this.destructor();\n }\n\n /**\n * Base call function for when this Updateable is to be paused.\n */\n pause() {\n if (!this.hasPaused) {\n this.hasPaused = true;\n this.onPause();\n }\n }\n\n /**\n * Base call function for when this Updateable is to be unpaused.\n */\n unpause() {\n if (this.hasPaused) {\n this.hasPaused = false;\n this.onUnpause();\n }\n }\n\n /**\n * Cleanup code for when destroying an Updateable.\n */\n destructor() {\n this.deregister();\n }\n\n /**\n * Called when the the object is first introduced.\n * \n * Managing code will call this on first iteration once introduced to the game loop.\n */\n onStart() {}\n\n /**\n * Called on every update within the game, once the object has had onStart called.\n */\n onUpdate() {}\n\n /**\n * Called when the object is being removed or cleaned up from usage.\n */\n onEnd() {}\n\n /**\n * Called when the object is intended to be paused.\n */\n onPause() {}\n\n /**\n * Called when the object is to be unpaused from paused state.\n */\n onUnpause() {}\n}",
"static": true,
"longname": "/Users/jaegarsarauer/Documents/DATA/CajartyComputing/Seed/SeedGameEngine/src/base/Updateable.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 57,
"kind": "class",
"name": "Updateable",
"memberof": "src/base/Updateable.js",
"static": true,
"longname": "src/base/Updateable.js~Updateable",
"access": "public",
"export": true,
"importPath": "seed-engine/src/base/Updateable.js",
"importStyle": "Updateable",
"description": "Baseclass for objects that follow the same ECS pattern of the seed engine.\n\nUsed in anything that should follow a create, update, end loop \nhandled by the Engine.\n\nMany things will need to update/start/end. If you derive something that\nhas the start()/update()/end()... functions, the children should fill in\ntheir respective callbacks (onStart()/onUpdate()/onEnd()/...).",
"lineNumber": 13,
"interface": false
},
{
"__docId__": 58,
"kind": "constructor",
"name": "constructor",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#constructor",
"access": "public",
"description": null,
"lineNumber": 14,
"undocument": true
},
{
"__docId__": 59,
"kind": "member",
"name": "hasStarted",
"memberof": "src/base/Updateable.js~Updateable",
"static": false,
"longname": "src/base/Updateable.js~Updateable#hasStarted",
"access": "public",
"description": null,
"lineNumber": 15,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 60,
"kind": "member",
"name": "hasPaused",
"memberof": "src/base/Updateable.js~Updateable",
"static": false,
"longname": "src/base/Updateable.js~Updateable#hasPaused",
"access": "public",
"description": null,
"lineNumber": 16,
"undocument": true,
"type": {
"types": [
"boolean"
]
}
},
{
"__docId__": 61,
"kind": "member",
"name": "id",
"memberof": "src/base/Updateable.js~Updateable",
"static": false,
"longname": "src/base/Updateable.js~Updateable#id",
"access": "public",
"description": null,
"lineNumber": 17,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 62,
"kind": "member",
"name": "deregister",
"memberof": "src/base/Updateable.js~Updateable",
"static": false,
"longname": "src/base/Updateable.js~Updateable#deregister",
"access": "public",
"description": null,
"lineNumber": 18,
"undocument": true,
"type": {
"types": [
"*"
]
}
},
{
"__docId__": 63,
"kind": "method",
"name": "start",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#start",
"access": "public",
"description": "Base call function for when this Updateable is to be started.",
"lineNumber": 24,
"params": [],
"return": null
},
{
"__docId__": 65,
"kind": "method",
"name": "update",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#update",
"access": "public",
"description": "Base call function for when this Updateable is to be updated.",
"lineNumber": 32,
"params": [],
"return": null
},
{
"__docId__": 66,
"kind": "method",
"name": "end",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#end",
"access": "public",
"description": "Base call function for when this Updateable is to be ended.",
"lineNumber": 47,
"params": [],
"return": null
},
{
"__docId__": 67,
"kind": "method",
"name": "pause",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#pause",
"access": "public",
"description": "Base call function for when this Updateable is to be paused.",
"lineNumber": 55,
"params": [],
"return": null
},
{
"__docId__": 69,
"kind": "method",
"name": "unpause",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#unpause",
"access": "public",
"description": "Base call function for when this Updateable is to be unpaused.",
"lineNumber": 65,
"params": [],
"return": null
},
{
"__docId__": 71,
"kind": "method",
"name": "destructor",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#destructor",
"access": "public",
"description": "Cleanup code for when destroying an Updateable.",
"lineNumber": 75,
"params": [],
"return": null
},
{
"__docId__": 72,
"kind": "method",
"name": "onStart",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#onStart",
"access": "public",
"description": "Called when the the object is first introduced.\n\nManaging code will call this on first iteration once introduced to the game loop.",
"lineNumber": 84,
"params": [],
"return": null
},
{
"__docId__": 73,
"kind": "method",
"name": "onUpdate",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#onUpdate",
"access": "public",
"description": "Called on every update within the game, once the object has had onStart called.",
"lineNumber": 89,
"params": [],
"return": null
},
{
"__docId__": 74,
"kind": "method",
"name": "onEnd",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#onEnd",
"access": "public",
"description": "Called when the object is being removed or cleaned up from usage.",
"lineNumber": 94,
"params": [],
"return": null
},
{
"__docId__": 75,
"kind": "method",
"name": "onPause",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#onPause",
"access": "public",
"description": "Called when the object is intended to be paused.",
"lineNumber": 99,
"params": [],
"return": null
},
{
"__docId__": 76,
"kind": "method",
"name": "onUnpause",
"memberof": "src/base/Updateable.js~Updateable",
"generator": false,
"async": false,
"static": false,
"longname": "src/base/Updateable.js~Updateable#onUnpause",
"access": "public",
"description": "Called when the object is to be unpaused from paused state.",
"lineNumber": 104,
"params": [],
"return": null
},
{
"__docId__": 77,
"kind": "file",
"name": "src/component/Animation.js",
"content": "import Component from './Component';\n\n/**\n * Animation component to be added to a GameObject to create animations inline with\n * the global game loop. Animation Components currently only offer transform interpolation\n * frames. Using buildInterpolation can be used to make custom animations which last n frames.\n */\nexport default class Animation extends Component {\n\n /**\n * Constructor for the animation component. A GameObject may have more than one Animation component.\n */\n constructor() {\n super(false);\n this.className = 'Animation';\n this.interpolationData = {};\n this.animationFrames = 0;\n }\n\n /**\n * Returns the frames left until all animations are complete.\n */\n animationFramesLeft() {\n return this.animationFrames;\n }\n\n /**\n * Checks to see if an animation, defined by the interpol animation key, \n * still has frames left to complete the animation.\n * \n * @param {string} interpol Animation interpolation key.\n */\n isAnimating(interpol = null) {\n if (interpol == null)\n return Object.keys(this.interpolationData).length > 0;\n return this.interpolationData[interpol] != null;\n }\n\n /**\n * Adds an animation to the Animation component. The animation component will keep track\n * and trigger the animation frames once per game tick until there are no more frames left.\n * On the final frame, the finalFrame callback will be called instead.\n * \n * @param {string} key Animation interpolation key.\n * @param {number} frames How many game ticks will this animation run.\n * @param {function} frameChange Callback function executed once per animation frame.\n * @param {function} finalFrame Callback function execured as the last frame. Defaults to frameChange.\n */\n buildInterpolation(key, frames, frameChange, finalFrame = frameChange) {\n this.interpolationData[key] = {\n frameChange,\n finalFrame,\n framesLeft: frames,\n };\n }\n\n /**\n * Clears an animation from executing any more frames. The animation to remove is defined\n * by the key parameter.\n * \n * @param {string} key Animation interpolation key.\n */\n clearAnimation(key) {\n delete this.interpolationData[key];\n }\n\n /**\n * Clear all animations on this Animation component.\n */\n clearAnimations() {\n this.interpolationData = {};\n this.animationFrames = 0;\n }\n\n /**\n * Wrapper function for creating animations of moving from one point to another (translating).\n * \n * @param {number} posX X position move per frame.\n * @param {number} posY Y position move per frame.\n * @param {number} posZ Z position move per frame.\n * @param {number} frames Amount of frames in this animation.\n * @param {number} cycles Amount of times to repeat this animation.\n * @param {boolean} reset Reset the position on animation finish.\n */\n interpolatePosition(posX = 0, posY = 0, posZ = 0, frames = 1, cycles = 1, reset = false) {\n let start = this.gameObject.transform.getPosition();\n this.buildInterpolation('position', frames, () => {\n this.gameObject.transform.translate(posX, posY, posZ);\n }, () => {\n this.gameObject.transform.setPosition(start.x + (reset ? 0 : posX * frames), start.y + (reset ? 0 : posY * frames), start.z + (reset ? 0 : posZ * frames));\n if (--cycles > 0)\n this.interpolatePosition(posX, posY, posZ, frames, cycles, reset);\n })\n }\n\n /**\n * Wrapper function for creating animations to change the scale of the GameObject.\n * \n * @param {number} posX X scale change per frame.\n * @param {number} posY Y scale change per frame.\n * @param {number} posZ Z scale change per frame.\n * @param {number} frames Amount of frames in this animation.\n * @param {number} cycles Amount of times to repeat this animation.\n * @param {boolean} reset Reset the position on animation finish.\n */\n interpolateScale(scaleX = 0, scaleY = 0, scaleZ = 0, frames = 1, cycles = 1, reset = false) {\n let start = this.gameObject.transform.getScale();\n this.buildInterpolation('scale', frames, () => {\n this.gameObject.transform.scale(scaleX, scaleY, scaleZ);\n },() => {\n this.gameObject.transform.setScale(start.x + (reset ? 0 : scaleX * frames), start.y + (reset ? 0 : scaleY * frames), start.z + (reset ? 0 : scaleZ * frames));\n if (--cycles > 0)\n this.interpolateScale(scaleX, scaleY, scaleZ, frames, cycles, reset);\n });\n }\n\n /**\n * Wrapper function for creating animations to rotate the GameObject.\n * \n * @param {number} posX X scale change per frame.\n * @param {number} posY Y scale change per frame.\n * @param {number} posZ Z scale change per frame.\n * @param {number} frames Amount of frames in this animation.\n * @param {number} cycles Amount of times to repeat this animation.\n * @param {boolean} reset Reset the position on animation finish.\n */\n interpolateRotation(rotate, frames = 1, cycles = 1, reset = false) {\n let start = this.gameObject.transform.getRotation();\n this.buildInterpolation('rotation', frames, () => {\n this.gameObject.transform.rotate(rotate);\n },() => {\n this.gameObject.transform.setRotation(start + (reset ? 0 : rotate * frames));\n if (--cycles > 0)\n this.interpolateRotation(rotate, frames, cycles, reset);\n });\n }\n\n /**\n * onUpdate is called automatically as a Component. Executes a frame for each animation.\n */\n onUpdate() {\n let newFrameCount = --this.animationFrames;\n let interpols = Object.keys(this.interpolationData);\n for (let i = 0; i < interpols.length; i++) {\n let interpol = this.interpolationData[interpols[i]];\n newFrameCount = Math.max(this.animationFrames, interpol.framesLeft - 1);\n if (interpol.framesLeft > 1) {\n interpol.frameChange();\n interpol.framesLeft--;\n } else if (interpol.framesLeft >= 1) {\n interpol.finalFrame();\n interpol.framesLeft--;\n } else if (interpol.framesLeft < 1) {\n delete this.interpolationData[interpols[i]];\n }\n }\n this.animationFrames = newFrameCount;\n }\n}",
"static": true,
"longname": "/Users/jaegarsarauer/Documents/DATA/CajartyComputing/Seed/SeedGameEngine/src/component/Animation.js",
"access": "public",
"description": null,
"lineNumber": 1
},
{
"__docId__": 78,
"kind": "class",
"name": "Animation",
"memberof": "src/component/Animation.js",
"static": true,
"longname": "src/component/Animation.js~Animation",
"access": "public",
"export": true,
"importPath": "seed-engine/src/component/Animation.js",
"importStyle": "Animation",
"description": "Animation component to be added to a GameObject to create animations inline with\nthe global game loop. Animation Components currently only offer transform interpolation\nframes. Using buildInterpolation can be used to make custom animations which last n frames.",
"lineNumber": 8,
"interface": false,
"extends": [
"src/component/Component.js~Component"
]
},
{
"__docId__": 79,
"kind": "constructor",
"name": "constructor",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#constructor",
"access": "public",
"description": "Constructor for the animation component. A GameObject may have more than one Animation component.",
"lineNumber": 13
},
{
"__docId__": 80,
"kind": "member",
"name": "className",
"memberof": "src/component/Animation.js~Animation",
"static": false,
"longname": "src/component/Animation.js~Animation#className",
"access": "public",
"description": null,
"lineNumber": 15,
"undocument": true,
"type": {
"types": [
"string"
]
}
},
{
"__docId__": 81,
"kind": "member",
"name": "interpolationData",
"memberof": "src/component/Animation.js~Animation",
"static": false,
"longname": "src/component/Animation.js~Animation#interpolationData",
"access": "public",
"description": null,
"lineNumber": 16,
"undocument": true,
"type": {
"types": [
"{}"
]
}
},
{
"__docId__": 82,
"kind": "member",
"name": "animationFrames",
"memberof": "src/component/Animation.js~Animation",
"static": false,
"longname": "src/component/Animation.js~Animation#animationFrames",
"access": "public",
"description": null,
"lineNumber": 17,
"undocument": true,
"type": {
"types": [
"number"
]
}
},
{
"__docId__": 83,
"kind": "method",
"name": "animationFramesLeft",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#animationFramesLeft",
"access": "public",
"description": "Returns the frames left until all animations are complete.",
"lineNumber": 23,
"params": [],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 84,
"kind": "method",
"name": "isAnimating",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#isAnimating",
"access": "public",
"description": "Checks to see if an animation, defined by the interpol animation key, \nstill has frames left to complete the animation.",
"lineNumber": 33,
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "interpol",
"description": "Animation interpolation key."
}
],
"return": {
"types": [
"*"
]
}
},
{
"__docId__": 85,
"kind": "method",
"name": "buildInterpolation",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#buildInterpolation",
"access": "public",
"description": "Adds an animation to the Animation component. The animation component will keep track\nand trigger the animation frames once per game tick until there are no more frames left.\nOn the final frame, the finalFrame callback will be called instead.",
"lineNumber": 49,
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "key",
"description": "Animation interpolation key."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "frames",
"description": "How many game ticks will this animation run."
},
{
"nullable": null,
"types": [
"function"
],
"spread": false,
"optional": false,
"name": "frameChange",
"description": "Callback function executed once per animation frame."
},
{
"nullable": null,
"types": [
"function"
],
"spread": false,
"optional": false,
"name": "finalFrame",
"description": "Callback function execured as the last frame. Defaults to frameChange."
}
],
"return": null
},
{
"__docId__": 86,
"kind": "method",
"name": "clearAnimation",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#clearAnimation",
"access": "public",
"description": "Clears an animation from executing any more frames. The animation to remove is defined\nby the key parameter.",
"lineNumber": 63,
"params": [
{
"nullable": null,
"types": [
"string"
],
"spread": false,
"optional": false,
"name": "key",
"description": "Animation interpolation key."
}
],
"return": null
},
{
"__docId__": 87,
"kind": "method",
"name": "clearAnimations",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#clearAnimations",
"access": "public",
"description": "Clear all animations on this Animation component.",
"lineNumber": 70,
"params": [],
"return": null
},
{
"__docId__": 90,
"kind": "method",
"name": "interpolatePosition",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#interpolatePosition",
"access": "public",
"description": "Wrapper function for creating animations of moving from one point to another (translating).",
"lineNumber": 85,
"params": [
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posX",
"description": "X position move per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posY",
"description": "Y position move per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posZ",
"description": "Z position move per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "frames",
"description": "Amount of frames in this animation."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "cycles",
"description": "Amount of times to repeat this animation."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "reset",
"description": "Reset the position on animation finish."
}
],
"return": null
},
{
"__docId__": 91,
"kind": "method",
"name": "interpolateScale",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#interpolateScale",
"access": "public",
"description": "Wrapper function for creating animations to change the scale of the GameObject.",
"lineNumber": 106,
"params": [
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posX",
"description": "X scale change per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posY",
"description": "Y scale change per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posZ",
"description": "Z scale change per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "frames",
"description": "Amount of frames in this animation."
},
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "cycles",
"description": "Amount of times to repeat this animation."
},
{
"nullable": null,
"types": [
"boolean"
],
"spread": false,
"optional": false,
"name": "reset",
"description": "Reset the position on animation finish."
}
],
"return": null
},
{
"__docId__": 92,
"kind": "method",
"name": "interpolateRotation",
"memberof": "src/component/Animation.js~Animation",
"generator": false,
"async": false,
"static": false,
"longname": "src/component/Animation.js~Animation#interpolateRotation",
"access": "public",
"description": "Wrapper function for creating animations to rotate the GameObject.",
"lineNumber": 127,
"params": [
{
"nullable": null,
"types": [
"number"
],
"spread": false,
"optional": false,
"name": "posX",
"description": "X scale change per frame."
},
{
"nullable": null,
"types": [
"number"
],
"spread": f