melonjs 10.3.0 → 10.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +6 -6
  2. package/dist/melonjs.js +3147 -3293
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3411 -3852
  5. package/dist/melonjs.module.js +3448 -3210
  6. package/package.json +18 -17
  7. package/src/audio/audio.js +29 -30
  8. package/src/camera/camera2d.js +46 -56
  9. package/src/entity/entity.js +30 -36
  10. package/src/game.js +21 -22
  11. package/src/geometries/ellipse.js +40 -46
  12. package/src/geometries/line.js +9 -11
  13. package/src/geometries/poly.js +53 -53
  14. package/src/geometries/rectangle.js +42 -44
  15. package/src/index.js +9 -26
  16. package/src/input/gamepad.js +11 -10
  17. package/src/input/input.js +2 -3
  18. package/src/input/keyboard.js +113 -113
  19. package/src/input/pointer.js +30 -31
  20. package/src/input/pointerevent.js +26 -26
  21. package/src/lang/deprecated.js +65 -6
  22. package/src/level/level.js +23 -24
  23. package/src/level/tiled/TMXGroup.js +7 -8
  24. package/src/level/tiled/TMXLayer.js +30 -32
  25. package/src/level/tiled/TMXObject.js +21 -21
  26. package/src/level/tiled/TMXTile.js +18 -18
  27. package/src/level/tiled/TMXTileMap.js +39 -44
  28. package/src/level/tiled/TMXTileset.js +12 -15
  29. package/src/level/tiled/TMXTilesetGroup.js +9 -9
  30. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -8
  31. package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -8
  32. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -5
  33. package/src/level/tiled/renderer/TMXRenderer.js +24 -25
  34. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -4
  35. package/src/loader/loader.js +14 -15
  36. package/src/loader/loadingscreen.js +2 -4
  37. package/src/math/color.js +47 -66
  38. package/src/math/math.js +15 -16
  39. package/src/math/matrix2.js +53 -58
  40. package/src/math/matrix3.js +56 -62
  41. package/src/math/observable_vector2.js +75 -76
  42. package/src/math/observable_vector3.js +79 -80
  43. package/src/math/vector2.js +91 -92
  44. package/src/math/vector3.js +94 -96
  45. package/src/particles/emitter.js +38 -40
  46. package/src/particles/particle.js +4 -5
  47. package/src/particles/particlecontainer.js +2 -3
  48. package/src/physics/body.js +46 -143
  49. package/src/physics/bounds.js +47 -47
  50. package/src/physics/collision.js +13 -14
  51. package/src/physics/detector.js +18 -17
  52. package/src/physics/quadtree.js +17 -19
  53. package/src/physics/sat.js +26 -26
  54. package/src/physics/world.js +24 -28
  55. package/src/plugin/plugin.js +11 -14
  56. package/src/renderable/GUI.js +41 -46
  57. package/src/renderable/collectable.js +4 -8
  58. package/src/renderable/colorlayer.js +6 -10
  59. package/src/renderable/container.js +87 -72
  60. package/src/renderable/dragndrop.js +224 -0
  61. package/src/renderable/imagelayer.js +25 -31
  62. package/src/renderable/nineslicesprite.js +41 -41
  63. package/src/renderable/renderable.js +114 -125
  64. package/src/renderable/sprite.js +62 -68
  65. package/src/renderable/trigger.js +25 -30
  66. package/src/state/stage.js +13 -17
  67. package/src/state/state.js +26 -27
  68. package/src/system/device.js +74 -75
  69. package/src/system/event.js +71 -72
  70. package/src/system/pooling.js +11 -12
  71. package/src/system/save.js +3 -4
  72. package/src/system/timer.js +19 -20
  73. package/src/text/bitmaptext.js +57 -54
  74. package/src/text/bitmaptextdata.js +10 -10
  75. package/src/text/glyph.js +3 -0
  76. package/src/text/text.js +44 -49
  77. package/src/tweens/easing.js +1 -1
  78. package/src/tweens/interpolation.js +1 -1
  79. package/src/tweens/tween.js +43 -44
  80. package/src/utils/agent.js +3 -4
  81. package/src/utils/array.js +4 -5
  82. package/src/utils/file.js +3 -4
  83. package/src/utils/function.js +4 -5
  84. package/src/utils/string.js +7 -9
  85. package/src/utils/utils.js +4 -5
  86. package/src/video/canvas/canvas_renderer.js +58 -59
  87. package/src/video/renderer.js +49 -53
  88. package/src/video/texture.js +98 -111
  89. package/src/video/texture_cache.js +24 -6
  90. package/src/video/video.js +16 -17
  91. package/src/video/webgl/glshader.js +37 -38
  92. package/src/video/webgl/webgl_compositor.js +31 -32
  93. package/src/video/webgl/webgl_renderer.js +79 -80
  94. package/src/entity/draggable.js +0 -130
  95. package/src/entity/droptarget.js +0 -101
@@ -3,7 +3,6 @@ import EventEmitter from "eventemitter3";
3
3
  /**
4
4
  * an event system based on nodeJS EventEmitter interface
5
5
  * @namespace event
6
- * @memberof me
7
6
  */
8
7
 
9
8
  // internal instance of the event emiter
@@ -15,8 +14,8 @@ var eventEmitter = new EventEmitter();
15
14
  * @constant
16
15
  * @type {string}
17
16
  * @name BOOT
18
- * @memberof me.event
19
- * @see me.event.on
17
+ * @memberof event
18
+ * @see event.on
20
19
  */
21
20
  export const BOOT = "me.boot";
22
21
 
@@ -27,8 +26,8 @@ export const BOOT = "me.boot";
27
26
  * @constant
28
27
  * @type {string}
29
28
  * @name STATE_PAUSE
30
- * @memberof me.event
31
- * @see me.event.on
29
+ * @memberof event
30
+ * @see event.on
32
31
  */
33
32
  export const STATE_PAUSE = "me.state.onPause";
34
33
 
@@ -39,8 +38,8 @@ export const STATE_PAUSE = "me.state.onPause";
39
38
  * @constant
40
39
  * @type {string}
41
40
  * @name STATE_RESUME
42
- * @memberof me.event
43
- * @see me.event.on
41
+ * @memberof event
42
+ * @see event.on
44
43
  */
45
44
  export const STATE_RESUME = "me.state.onResume";
46
45
 
@@ -51,8 +50,8 @@ export const STATE_RESUME = "me.state.onResume";
51
50
  * @constant
52
51
  * @type {string}
53
52
  * @name STATE_STOP
54
- * @memberof me.event
55
- * @see me.event.on
53
+ * @memberof event
54
+ * @see event.on
56
55
  */
57
56
  export const STATE_STOP = "me.state.onStop";
58
57
 
@@ -63,8 +62,8 @@ export const STATE_STOP = "me.state.onStop";
63
62
  * @constant
64
63
  * @type {string}
65
64
  * @name STATE_RESTART
66
- * @memberof me.event
67
- * @see me.event.on
65
+ * @memberof event
66
+ * @see event.on
68
67
  */
69
68
  export const STATE_RESTART = "me.state.onRestart";
70
69
 
@@ -75,9 +74,9 @@ export const STATE_RESTART = "me.state.onRestart";
75
74
  * @constant
76
75
  * @type {string}
77
76
  * @name VIDEO_INIT
78
- * @memberof me.event
79
- * @see me.video.init
80
- * @see me.event.on
77
+ * @memberof event
78
+ * @see video.init
79
+ * @see event.on
81
80
  */
82
81
  export const VIDEO_INIT = "me.video.onInit";
83
82
 
@@ -88,8 +87,8 @@ export const VIDEO_INIT = "me.video.onInit";
88
87
  * @constant
89
88
  * @type {string}
90
89
  * @name GAME_INIT
91
- * @memberof me.event
92
- * @see me.event.on
90
+ * @memberof event
91
+ * @see event.on
93
92
  */
94
93
  export const GAME_INIT = "me.game.onInit";
95
94
 
@@ -100,8 +99,8 @@ export const GAME_INIT = "me.game.onInit";
100
99
  * @constant
101
100
  * @type {string}
102
101
  * @name GAME_RESET
103
- * @memberof me.event
104
- * @see me.event.on
102
+ * @memberof event
103
+ * @see event.on
105
104
  */
106
105
  export const GAME_RESET = "me.game.onReset";
107
106
 
@@ -112,8 +111,8 @@ export const GAME_RESET = "me.game.onReset";
112
111
  * @constant
113
112
  * @type {string}
114
113
  * @name GAME_BEFORE_UPDATE
115
- * @memberof me.event
116
- * @see me.event.on
114
+ * @memberof event
115
+ * @see event.on
117
116
  */
118
117
  export const GAME_BEFORE_UPDATE = "me.game.beforeUpdate";
119
118
 
@@ -124,8 +123,8 @@ export const GAME_BEFORE_UPDATE = "me.game.beforeUpdate";
124
123
  * @constant
125
124
  * @type {string}
126
125
  * @name GAME_AFTER_UPDATE
127
- * @memberof me.event
128
- * @see me.event.on
126
+ * @memberof event
127
+ * @see event.on
129
128
  */
130
129
  export const GAME_AFTER_UPDATE = "me.game.afterUpdate";
131
130
 
@@ -136,8 +135,8 @@ export const GAME_AFTER_UPDATE = "me.game.afterUpdate";
136
135
  * @constant
137
136
  * @type {string}
138
137
  * @name GAME_UPDATE
139
- * @memberof me.event
140
- * @see me.event.on
138
+ * @memberof event
139
+ * @see event.on
141
140
  */
142
141
  export const GAME_UPDATE = "me.game.onUpdate";
143
142
 
@@ -148,8 +147,8 @@ export const GAME_UPDATE = "me.game.onUpdate";
148
147
  * @constant
149
148
  * @type {string}
150
149
  * @name GAME_BEFORE_DRAW
151
- * @memberof me.event
152
- * @see me.event.on
150
+ * @memberof event
151
+ * @see event.on
153
152
  */
154
153
  export const GAME_BEFORE_DRAW = "me.game.beforeDraw";
155
154
 
@@ -160,8 +159,8 @@ export const GAME_BEFORE_DRAW = "me.game.beforeDraw";
160
159
  * @constant
161
160
  * @type {string}
162
161
  * @name GAME_AFTER_DRAW
163
- * @memberof me.event
164
- * @see me.event.on
162
+ * @memberof event
163
+ * @see event.on
165
164
  */
166
165
  export const GAME_AFTER_DRAW = "me.game.afterDraw";
167
166
 
@@ -172,8 +171,8 @@ export const GAME_AFTER_DRAW = "me.game.afterDraw";
172
171
  * @constant
173
172
  * @type {string}
174
173
  * @name LEVEL_LOADED
175
- * @memberof me.event
176
- * @see me.event.on
174
+ * @memberof event
175
+ * @see event.on
177
176
  */
178
177
  export const LEVEL_LOADED = "me.game.onLevelLoaded";
179
178
 
@@ -184,8 +183,8 @@ export const LEVEL_LOADED = "me.game.onLevelLoaded";
184
183
  * @constant
185
184
  * @type {string}
186
185
  * @name LOADER_COMPLETE
187
- * @memberof me.event
188
- * @see me.event.on
186
+ * @memberof event
187
+ * @see event.on
189
188
  */
190
189
  export const LOADER_COMPLETE = "me.loader.onload";
191
190
 
@@ -196,8 +195,8 @@ export const LOADER_COMPLETE = "me.loader.onload";
196
195
  * @constant
197
196
  * @type {string}
198
197
  * @name LOADER_PROGRESS
199
- * @memberof me.event
200
- * @see me.event.on
198
+ * @memberof event
199
+ * @see event.on
201
200
  */
202
201
  export const LOADER_PROGRESS = "me.loader.onProgress";
203
202
 
@@ -213,8 +212,8 @@ export const LOADER_PROGRESS = "me.loader.onProgress";
213
212
  * @constant
214
213
  * @type {string}
215
214
  * @name KEYDOWN
216
- * @memberof me.event
217
- * @see me.event.on
215
+ * @memberof event
216
+ * @see event.on
218
217
  * @example
219
218
  * me.input.bindKey(me.input.KEY.X, "jump", true); // Edge-triggered
220
219
  * me.input.bindKey(me.input.KEY.Z, "shoot"); // Level-triggered
@@ -239,8 +238,8 @@ export const KEYDOWN = "me.input.keydown";
239
238
  * @constant
240
239
  * @type {string}
241
240
  * @name KEYUP
242
- * @memberof me.event
243
- * @see me.event.on
241
+ * @memberof event
242
+ * @see event.on
244
243
  * @example
245
244
  * me.event.on(me.event.KEYUP, (action, keyCode) => {
246
245
  * // Checking unbound keys
@@ -263,8 +262,8 @@ export const KEYUP = "me.input.keyup";
263
262
  * @constant
264
263
  * @type {string}
265
264
  * @name GAMEPAD_CONNECTED
266
- * @memberof me.event
267
- * @see me.event.on
265
+ * @memberof event
266
+ * @see event.on
268
267
  */
269
268
  export const GAMEPAD_CONNECTED = "gamepad.connected";
270
269
 
@@ -275,8 +274,8 @@ export const GAMEPAD_CONNECTED = "gamepad.connected";
275
274
  * @constant
276
275
  * @type {string}
277
276
  * @name GAMEPAD_DISCONNECTED
278
- * @memberof me.event
279
- * @see me.event.on
277
+ * @memberof event
278
+ * @see event.on
280
279
  */
281
280
  export const GAMEPAD_DISCONNECTED = "gamepad.disconnected";
282
281
 
@@ -291,8 +290,8 @@ export const GAMEPAD_DISCONNECTED = "gamepad.disconnected";
291
290
  * @constant
292
291
  * @type {string}
293
292
  * @name GAMEPAD_UPDATE
294
- * @memberof me.event
295
- * @see me.event.on
293
+ * @memberof event
294
+ * @see event.on
296
295
  */
297
296
  export const GAMEPAD_UPDATE = "gamepad.update";
298
297
 
@@ -303,8 +302,8 @@ export const GAMEPAD_UPDATE = "gamepad.update";
303
302
  * @constant
304
303
  * @type {string}
305
304
  * @name POINTERMOVE
306
- * @memberof me.event
307
- * @see me.event.on
305
+ * @memberof event
306
+ * @see event.on
308
307
  */
309
308
  export const POINTERMOVE = "me.event.pointermove";
310
309
 
@@ -315,8 +314,8 @@ export const POINTERMOVE = "me.event.pointermove";
315
314
  * @constant
316
315
  * @type {string}
317
316
  * @name POINTERLOCKCHANGE
318
- * @memberof me.event
319
- * @see me.event.on
317
+ * @memberof event
318
+ * @see event.on
320
319
  */
321
320
  export const POINTERLOCKCHANGE = "me.event.pointerlockChange";
322
321
 
@@ -329,8 +328,8 @@ export const POINTERLOCKCHANGE = "me.event.pointerlockChange";
329
328
  * @constant
330
329
  * @type {string}
331
330
  * @name DRAGSTART
332
- * @memberof me.event
333
- * @see me.event.on
331
+ * @memberof event
332
+ * @see event.on
334
333
  */
335
334
  export const DRAGSTART = "me.game.dragstart";
336
335
 
@@ -343,8 +342,8 @@ export const DRAGSTART = "me.game.dragstart";
343
342
  * @constant
344
343
  * @type {string}
345
344
  * @name DRAGEND
346
- * @memberof me.event
347
- * @see me.event.on
345
+ * @memberof event
346
+ * @see event.on
348
347
  */
349
348
  export const DRAGEND = "me.game.dragend";
350
349
 
@@ -355,8 +354,8 @@ export const DRAGEND = "me.game.dragend";
355
354
  * @constant
356
355
  * @type {string}
357
356
  * @name WINDOW_ONRESIZE
358
- * @memberof me.event
359
- * @see me.event.on
357
+ * @memberof event
358
+ * @see event.on
360
359
  */
361
360
  export const WINDOW_ONRESIZE = "window.onresize";
362
361
 
@@ -369,8 +368,8 @@ export const WINDOW_ONRESIZE = "window.onresize";
369
368
  * @constant
370
369
  * @type {string}
371
370
  * @name CANVAS_ONRESIZE
372
- * @memberof me.event
373
- * @see me.event.on
371
+ * @memberof event
372
+ * @see event.on
374
373
  */
375
374
  export const CANVAS_ONRESIZE = "canvas.onresize";
376
375
 
@@ -383,8 +382,8 @@ export const CANVAS_ONRESIZE = "canvas.onresize";
383
382
  * @constant
384
383
  * @type {string}
385
384
  * @name VIEWPORT_ONRESIZE
386
- * @memberof me.event
387
- * @see me.event.on
385
+ * @memberof event
386
+ * @see event.on
388
387
  */
389
388
  export const VIEWPORT_ONRESIZE = "viewport.onresize";
390
389
 
@@ -395,8 +394,8 @@ export const VIEWPORT_ONRESIZE = "viewport.onresize";
395
394
  * @constant
396
395
  * @type {string}
397
396
  * @name WINDOW_ONORIENTATION_CHANGE
398
- * @memberof me.event
399
- * @see me.event.on
397
+ * @memberof event
398
+ * @see event.on
400
399
  */
401
400
  export const WINDOW_ONORIENTATION_CHANGE = "window.orientationchange";
402
401
 
@@ -407,8 +406,8 @@ export const WINDOW_ONORIENTATION_CHANGE = "window.orientationchange";
407
406
  * @constant
408
407
  * @type {string}
409
408
  * @name WINDOW_ONSCROLL
410
- * @memberof me.event
411
- * @see me.event.on
409
+ * @memberof event
410
+ * @see event.on
412
411
  */
413
412
  export const WINDOW_ONSCROLL = "window.onscroll";
414
413
 
@@ -419,8 +418,8 @@ export const WINDOW_ONSCROLL = "window.onscroll";
419
418
  * @constant
420
419
  * @type {string}
421
420
  * @name VIEWPORT_ONCHANGE
422
- * @memberof me.event
423
- * @see me.event.on
421
+ * @memberof event
422
+ * @see event.on
424
423
  */
425
424
  export const VIEWPORT_ONCHANGE = "viewport.onchange";
426
425
 
@@ -431,8 +430,8 @@ export const VIEWPORT_ONCHANGE = "viewport.onchange";
431
430
  * @constant
432
431
  * @type {string}
433
432
  * @name WEBGL_ONCONTEXT_LOST
434
- * @memberof me.event
435
- * @see me.event.on
433
+ * @memberof event
434
+ * @see event.on
436
435
  */
437
436
  export const WEBGL_ONCONTEXT_LOST = "renderer.webglcontextlost";
438
437
 
@@ -443,14 +442,14 @@ export const WEBGL_ONCONTEXT_LOST = "renderer.webglcontextlost";
443
442
  * @constant
444
443
  * @type {string}
445
444
  * @name WEBGL_ONCONTEXT_RESTORED
446
- * @memberof me.event
447
- * @see me.event.on
445
+ * @memberof event
446
+ * @see event.on
448
447
  */
449
448
  export const WEBGL_ONCONTEXT_RESTORED = "renderer.webglcontextrestored";
450
449
 
451
450
  /**
452
451
  * calls each of the listeners registered for a given event.
453
- * @function me.event.emit
452
+ * @function event.emit
454
453
  * @param {string|symbol} eventName The event name.
455
454
  * @param {object} [...arguments] arguments to be passed to all listeners
456
455
  * @returns {boolean} true if the event had listeners, false otherwise.
@@ -463,7 +462,7 @@ export function emit(eventName, ...args) {
463
462
 
464
463
  /**
465
464
  * Add a listener for a given event.
466
- * @function me.event.on
465
+ * @function event.on
467
466
  * @param {string|symbol} eventName The event name.
468
467
  * @param {Function} listener The listener function.
469
468
  * @param {*} [context=this] The context to invoke the listener with.
@@ -478,7 +477,7 @@ export function on(eventName, listener, context) {
478
477
 
479
478
  /**
480
479
  * Add a one-time listener for a given event.
481
- * @function me.event.once
480
+ * @function event.once
482
481
  * @param {string|symbol} eventName The event name.
483
482
  * @param {Function} listener The listener function.
484
483
  * @param {*} [context=this] The context to invoke the listener with.
@@ -493,7 +492,7 @@ export function once(eventName, listener, context) {
493
492
 
494
493
  /**
495
494
  * remove the given listener for a given event.
496
- * @function me.event.off
495
+ * @function event.off
497
496
  * @param {string|symbol} eventName The event name.
498
497
  * @param {Function} listener The listener function.
499
498
  * @returns {EventEmitter} `this`.
@@ -12,8 +12,7 @@ var instance_counter = 0;
12
12
  * which means, that on level loading the engine will try to instantiate every object
13
13
  * found in the map, based on the user defined name in each Object Properties<br>
14
14
  * <img src="images/object_properties.png"/><br>
15
- * @namespace me.pool
16
- * @memberof me
15
+ * @namespace pool
17
16
  */
18
17
 
19
18
  var pool = {
@@ -22,7 +21,7 @@ var pool = {
22
21
  * register an object to the pool. <br>
23
22
  * Pooling must be set to true if more than one such objects will be created. <br>
24
23
  * (Note: for an object to be poolable, it must implements a `onResetEvent` method)
25
- * @function me.pool.register
24
+ * @function pool.register
26
25
  * @param {string} className as defined in the Name field of the Object Properties (in Tiled)
27
26
  * @param {object} classObj corresponding Class to be instantiated
28
27
  * @param {boolean} [recycling=false] enables object recycling for the specified class
@@ -50,8 +49,8 @@ var pool = {
50
49
 
51
50
  /**
52
51
  * Pull a new instance of the requested object (if added into the object pool)
53
- * @function me.pool.pull
54
- * @param {string} name as used in {@link me.pool.register}
52
+ * @function pool.pull
53
+ * @param {string} name as used in {@link pool.register}
55
54
  * @param {object} [...arguments] arguments to be passed when instantiating/reinitializing the object
56
55
  * @returns {object} the instance of the requested object
57
56
  * @example
@@ -107,7 +106,7 @@ var pool = {
107
106
  * purge the object pool from any inactive object <br>
108
107
  * Object pooling must be enabled for this function to work<br>
109
108
  * note: this will trigger the garbage collector
110
- * @function me.pool.purge
109
+ * @function pool.purge
111
110
  */
112
111
  purge() {
113
112
  for (var className in objectClass) {
@@ -121,9 +120,9 @@ var pool = {
121
120
  /**
122
121
  * Push back an object instance into the object pool <br>
123
122
  * Object pooling for the object class must be enabled,
124
- * and object must have been instantiated using {@link me.pool#pull},
123
+ * and object must have been instantiated using {@link pool#pull},
125
124
  * otherwise this function won't work
126
- * @function me.pool.push
125
+ * @function pool.push
127
126
  * @throws will throw an error if the object cannot be recycled
128
127
  * @param {object} obj instance to be recycled
129
128
  * @param {boolean} [throwOnError=true] throw an exception if the object cannot be recycled
@@ -147,7 +146,7 @@ var pool = {
147
146
 
148
147
  /**
149
148
  * Check if an object with the provided name is registered
150
- * @function me.pool.exists
149
+ * @function pool.exists
151
150
  * @param {string} name of the registered object class
152
151
  * @returns {boolean} true if the classname is registered
153
152
  */
@@ -158,8 +157,8 @@ var pool = {
158
157
  /**
159
158
  * Check if an object is poolable
160
159
  * (was properly registered with the recycling feature enable)
161
- * @function me.pool.poolable
162
- * @see me.pool.register
160
+ * @function pool.poolable
161
+ * @see pool.register
163
162
  * @param {object} obj object to be checked
164
163
  * @returns {boolean} true if the object is poolable
165
164
  * @example
@@ -178,7 +177,7 @@ var pool = {
178
177
 
179
178
  /**
180
179
  * returns the amount of object instance currently in the pool
181
- * @function me.pool.getInstanceCount
180
+ * @function pool.getInstanceCount
182
181
  * @returns {number} amount of object instance
183
182
  */
184
183
  getInstanceCount() {
@@ -29,8 +29,7 @@ import * as event from "./../system/event.js";
29
29
  *
30
30
  * // Remove "lives" from localStorage
31
31
  * me.save.remove("lives");
32
- * @namespace me.save
33
- * @memberof me
32
+ * @namespace save
34
33
  */
35
34
 
36
35
  // Variable to hold the object data
@@ -65,7 +64,7 @@ var save = {
65
64
  /**
66
65
  * Add new keys to localStorage and set them to the given default values if they do not exist
67
66
  * @name add
68
- * @memberof me.save
67
+ * @memberof save
69
68
  * @function
70
69
  * @param {object} props key and corresponding values
71
70
  * @example
@@ -119,7 +118,7 @@ var save = {
119
118
  /**
120
119
  * Remove a key from localStorage
121
120
  * @name remove
122
- * @memberof me.save
121
+ * @memberof save
123
122
  * @function
124
123
  * @param {string} key key to be removed
125
124
  * @example
@@ -87,22 +87,21 @@ event.on(event.BOOT, () => {
87
87
 
88
88
  /**
89
89
  * a Timer class to manage timing related function (FPS, Game Tick, Time...)
90
- * @namespace me.timer
91
- * @memberof me
90
+ * @namespace timer
92
91
  */
93
92
  var timer = {
94
93
 
95
94
  /**
96
95
  * Last game tick value.<br/>
97
96
  * Use this value to scale velocities during frame drops due to slow
98
- * hardware or when setting an FPS limit. (See {@link me.timer.maxfps})
97
+ * hardware or when setting an FPS limit. (See {@link timer.maxfps})
99
98
  * This feature is disabled by default. Enable me.timer.interpolation to
100
99
  * use it.
101
100
  * @public
102
- * @see me.timer.interpolation
101
+ * @see timer.interpolation
103
102
  * @type {number}
104
103
  * @name tick
105
- * @memberof me.timer
104
+ * @memberof timer
106
105
  */
107
106
  tick : 1.0,
108
107
 
@@ -112,35 +111,35 @@ var timer = {
112
111
  * @public
113
112
  * @type {number}
114
113
  * @name fps
115
- * @memberof me.timer
114
+ * @memberof timer
116
115
  */
117
116
  fps : 0,
118
117
 
119
118
  /**
120
119
  * Set the maximum target display frame per second
121
120
  * @public
122
- * @see me.timer.tick
121
+ * @see timer.tick
123
122
  * @type {number}
124
123
  * @name maxfps
125
124
  * @default 60
126
- * @memberof me.timer
125
+ * @memberof timer
127
126
  */
128
127
  maxfps : 60,
129
128
 
130
129
  /**
131
130
  * Enable/disable frame interpolation
132
- * @see me.timer.tick
131
+ * @see timer.tick
133
132
  * @type {boolean}
134
133
  * @default false
135
134
  * @name interpolation
136
- * @memberof me.timer
135
+ * @memberof timer
137
136
  */
138
137
  interpolation : false,
139
138
 
140
139
  /**
141
140
  * reset time (e.g. usefull in case of pause)
142
141
  * @name reset
143
- * @memberof me.timer
142
+ * @memberof timer
144
143
  * @ignore
145
144
  * @function
146
145
  */
@@ -159,11 +158,11 @@ var timer = {
159
158
  /**
160
159
  * Calls a function once after a specified delay. See me.timer.setInterval to repeativly call a function.
161
160
  * @name setTimeout
162
- * @memberof me.timer
161
+ * @memberof timer
163
162
  * @param {Function} fn the function you want to execute after delay milliseconds.
164
163
  * @param {number} delay the number of milliseconds (thousandths of a second) that the function call should be delayed by.
165
164
  * @param {boolean} [pauseable=true] respects the pause state of the engine.
166
- * @param {object} [args] optional parameters which are passed through to the function specified by fn once the timer expires.
165
+ * @param {...*} args optional parameters which are passed through to the function specified by fn once the timer expires.
167
166
  * @returns {number} The numerical ID of the timer, which can be used later with me.timer.clearTimeout().
168
167
  * @function
169
168
  * @example
@@ -188,11 +187,11 @@ var timer = {
188
187
  /**
189
188
  * Calls a function continously at the specified interval. See setTimeout to call function a single time.
190
189
  * @name setInterval
191
- * @memberof me.timer
190
+ * @memberof timer
192
191
  * @param {Function} fn the function to execute
193
192
  * @param {number} delay the number of milliseconds (thousandths of a second) on how often to execute the function
194
193
  * @param {boolean} [pauseable=true] respects the pause state of the engine.
195
- * @param {object} [args] optional parameters which are passed through to the function specified by fn once the timer expires.
194
+ * @param {...*} args optional parameters which are passed through to the function specified by fn once the timer expires.
196
195
  * @returns {number} The numerical ID of the timer, which can be used later with me.timer.clearInterval().
197
196
  * @function
198
197
  * @example
@@ -217,7 +216,7 @@ var timer = {
217
216
  /**
218
217
  * Clears the delay set by me.timer.setTimeout().
219
218
  * @name clearTimeout
220
- * @memberof me.timer
219
+ * @memberof timer
221
220
  * @function
222
221
  * @param {number} timeoutID ID of the timeout to be cleared
223
222
  */
@@ -228,7 +227,7 @@ var timer = {
228
227
  /**
229
228
  * Clears the Interval set by me.timer.setInterval().
230
229
  * @name clearInterval
231
- * @memberof me.timer
230
+ * @memberof timer
232
231
  * @function
233
232
  * @param {number} intervalID ID of the interval to be cleared
234
233
  */
@@ -240,7 +239,7 @@ var timer = {
240
239
  * Return the current timestamp in milliseconds <br>
241
240
  * since the game has started or since linux epoch (based on browser support for High Resolution Timer)
242
241
  * @name getTime
243
- * @memberof me.timer
242
+ * @memberof timer
244
243
  * @returns {number}
245
244
  * @function
246
245
  */
@@ -251,7 +250,7 @@ var timer = {
251
250
  /**
252
251
  * Return elapsed time in milliseconds since the last update
253
252
  * @name getDelta
254
- * @memberof me.timer
253
+ * @memberof timer
255
254
  * @returns {number}
256
255
  * @function
257
256
  */
@@ -263,7 +262,7 @@ var timer = {
263
262
  * compute the actual frame time and fps rate
264
263
  * @name computeFPS
265
264
  * @ignore
266
- * @memberof me.timer
265
+ * @memberof timer
267
266
  * @function
268
267
  */
269
268
  countFPS() {