melonjs 14.0.2 → 14.1.0

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 (214) hide show
  1. package/README.md +2 -0
  2. package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +10 -0
  3. package/dist/melonjs.mjs/_virtual/arraymultimap.js +10 -0
  4. package/dist/melonjs.mjs/_virtual/earcut.js +10 -0
  5. package/dist/melonjs.mjs/_virtual/howler.js +10 -0
  6. package/dist/melonjs.mjs/_virtual/index.js +10 -0
  7. package/dist/melonjs.mjs/_virtual/index2.js +10 -0
  8. package/dist/melonjs.mjs/_virtual/multimap.js +10 -0
  9. package/dist/melonjs.mjs/_virtual/setmultimap.js +10 -0
  10. package/dist/melonjs.mjs/application/application.js +240 -0
  11. package/dist/melonjs.mjs/audio/audio.js +536 -0
  12. package/dist/melonjs.mjs/camera/camera2d.js +732 -0
  13. package/dist/melonjs.mjs/entity/entity.js +248 -0
  14. package/dist/melonjs.mjs/game.js +29 -0
  15. package/dist/melonjs.mjs/geometries/ellipse.js +275 -0
  16. package/dist/melonjs.mjs/geometries/line.js +116 -0
  17. package/dist/melonjs.mjs/geometries/path2d.js +319 -0
  18. package/dist/melonjs.mjs/geometries/point.js +89 -0
  19. package/dist/melonjs.mjs/geometries/poly.js +500 -0
  20. package/dist/melonjs.mjs/geometries/rectangle.js +375 -0
  21. package/dist/melonjs.mjs/geometries/roundrect.js +168 -0
  22. package/dist/melonjs.mjs/index.js +248 -0
  23. package/dist/melonjs.mjs/input/gamepad.js +501 -0
  24. package/dist/melonjs.mjs/input/input.js +26 -0
  25. package/dist/melonjs.mjs/input/keyboard.js +470 -0
  26. package/dist/melonjs.mjs/input/pointer.js +393 -0
  27. package/dist/melonjs.mjs/input/pointerevent.js +818 -0
  28. package/dist/melonjs.mjs/lang/deprecated.js +157 -0
  29. package/dist/melonjs.mjs/level/level.js +297 -0
  30. package/dist/melonjs.mjs/level/tiled/TMXGroup.js +141 -0
  31. package/dist/melonjs.mjs/level/tiled/TMXLayer.js +448 -0
  32. package/dist/melonjs.mjs/level/tiled/TMXObject.js +355 -0
  33. package/dist/melonjs.mjs/level/tiled/TMXTile.js +194 -0
  34. package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +639 -0
  35. package/dist/melonjs.mjs/level/tiled/TMXTileset.js +311 -0
  36. package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +83 -0
  37. package/dist/melonjs.mjs/level/tiled/TMXUtils.js +367 -0
  38. package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +506 -0
  39. package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +220 -0
  40. package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +157 -0
  41. package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +125 -0
  42. package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +109 -0
  43. package/dist/melonjs.mjs/loader/loader.js +801 -0
  44. package/dist/melonjs.mjs/loader/loadingscreen.js +120 -0
  45. package/dist/melonjs.mjs/loader/melonjs_logo.png.js +11 -0
  46. package/dist/melonjs.mjs/math/color.js +618 -0
  47. package/dist/melonjs.mjs/math/math.js +218 -0
  48. package/dist/melonjs.mjs/math/matrix2.js +503 -0
  49. package/dist/melonjs.mjs/math/matrix3.js +681 -0
  50. package/dist/melonjs.mjs/math/observable_vector2.js +471 -0
  51. package/dist/melonjs.mjs/math/observable_vector3.js +561 -0
  52. package/dist/melonjs.mjs/math/vector2.js +528 -0
  53. package/dist/melonjs.mjs/math/vector3.js +569 -0
  54. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +73 -0
  55. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +21 -0
  56. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +324 -0
  57. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +69 -0
  58. package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +691 -0
  59. package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +350 -0
  60. package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +3241 -0
  61. package/dist/melonjs.mjs/particles/emitter.js +267 -0
  62. package/dist/melonjs.mjs/particles/particle.js +188 -0
  63. package/dist/melonjs.mjs/particles/settings.js +319 -0
  64. package/dist/melonjs.mjs/physics/body.js +704 -0
  65. package/dist/melonjs.mjs/physics/bounds.js +460 -0
  66. package/dist/melonjs.mjs/physics/collision.js +132 -0
  67. package/dist/melonjs.mjs/physics/detector.js +194 -0
  68. package/dist/melonjs.mjs/physics/quadtree.js +391 -0
  69. package/dist/melonjs.mjs/physics/response.js +57 -0
  70. package/dist/melonjs.mjs/physics/sat.js +483 -0
  71. package/dist/melonjs.mjs/physics/world.js +221 -0
  72. package/dist/melonjs.mjs/plugin/plugin.js +141 -0
  73. package/dist/melonjs.mjs/renderable/collectable.js +62 -0
  74. package/dist/melonjs.mjs/renderable/colorlayer.js +80 -0
  75. package/dist/melonjs.mjs/renderable/container.js +1018 -0
  76. package/dist/melonjs.mjs/renderable/dragndrop.js +224 -0
  77. package/dist/melonjs.mjs/renderable/imagelayer.js +306 -0
  78. package/dist/melonjs.mjs/renderable/light2d.js +156 -0
  79. package/dist/melonjs.mjs/renderable/nineslicesprite.js +247 -0
  80. package/dist/melonjs.mjs/renderable/renderable.js +783 -0
  81. package/dist/melonjs.mjs/renderable/sprite.js +654 -0
  82. package/dist/melonjs.mjs/renderable/trigger.js +157 -0
  83. package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +213 -0
  84. package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +226 -0
  85. package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +128 -0
  86. package/dist/melonjs.mjs/state/stage.js +237 -0
  87. package/dist/melonjs.mjs/state/state.js +596 -0
  88. package/dist/melonjs.mjs/system/device.js +909 -0
  89. package/dist/melonjs.mjs/system/dom.js +78 -0
  90. package/dist/melonjs.mjs/system/event.js +537 -0
  91. package/dist/melonjs.mjs/system/platform.js +41 -0
  92. package/dist/melonjs.mjs/system/pooling.js +209 -0
  93. package/dist/melonjs.mjs/system/save.js +157 -0
  94. package/dist/melonjs.mjs/system/timer.js +286 -0
  95. package/dist/melonjs.mjs/text/bitmaptext.js +364 -0
  96. package/dist/melonjs.mjs/text/bitmaptextdata.js +199 -0
  97. package/dist/melonjs.mjs/text/glyph.js +66 -0
  98. package/dist/melonjs.mjs/text/text.js +453 -0
  99. package/dist/melonjs.mjs/text/textmetrics.js +176 -0
  100. package/dist/melonjs.mjs/text/textstyle.js +23 -0
  101. package/dist/melonjs.mjs/tweens/easing.js +336 -0
  102. package/dist/melonjs.mjs/tweens/interpolation.js +112 -0
  103. package/dist/melonjs.mjs/tweens/tween.js +480 -0
  104. package/dist/melonjs.mjs/utils/agent.js +76 -0
  105. package/dist/melonjs.mjs/utils/array.js +63 -0
  106. package/dist/melonjs.mjs/utils/file.js +42 -0
  107. package/dist/melonjs.mjs/utils/function.js +70 -0
  108. package/dist/melonjs.mjs/utils/string.js +82 -0
  109. package/dist/melonjs.mjs/utils/utils.js +173 -0
  110. package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +807 -0
  111. package/dist/melonjs.mjs/video/renderer.js +411 -0
  112. package/dist/melonjs.mjs/video/texture/atlas.js +519 -0
  113. package/dist/melonjs.mjs/video/texture/cache.js +143 -0
  114. package/dist/melonjs.mjs/video/texture/canvas_texture.js +144 -0
  115. package/dist/melonjs.mjs/video/video.js +462 -0
  116. package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +143 -0
  117. package/dist/melonjs.mjs/video/webgl/glshader.js +168 -0
  118. package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +10 -0
  119. package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +10 -0
  120. package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +10 -0
  121. package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +10 -0
  122. package/dist/melonjs.mjs/video/webgl/utils/attributes.js +25 -0
  123. package/dist/melonjs.mjs/video/webgl/utils/precision.js +20 -0
  124. package/dist/melonjs.mjs/video/webgl/utils/program.js +67 -0
  125. package/dist/melonjs.mjs/video/webgl/utils/string.js +25 -0
  126. package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +92 -0
  127. package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +495 -0
  128. package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +1036 -0
  129. package/dist/melonjs.module.d.ts +1163 -1163
  130. package/dist/melonjs.module.js +1903 -3274
  131. package/package.json +22 -17
  132. package/src/application/application.js +3 -3
  133. package/src/audio/audio.js +32 -32
  134. package/src/camera/camera2d.js +31 -31
  135. package/src/entity/entity.js +17 -17
  136. package/src/geometries/ellipse.js +16 -16
  137. package/src/geometries/line.js +5 -5
  138. package/src/geometries/path2d.js +32 -32
  139. package/src/geometries/poly.js +15 -15
  140. package/src/geometries/rectangle.js +18 -18
  141. package/src/geometries/roundrect.js +8 -8
  142. package/src/input/gamepad.js +15 -15
  143. package/src/input/keyboard.js +12 -12
  144. package/src/input/pointer.js +6 -6
  145. package/src/input/pointerevent.js +12 -12
  146. package/src/lang/deprecated.js +12 -12
  147. package/src/level/level.js +25 -25
  148. package/src/level/tiled/TMXLayer.js +22 -22
  149. package/src/level/tiled/TMXTile.js +5 -5
  150. package/src/level/tiled/TMXTileMap.js +6 -6
  151. package/src/level/tiled/TMXTileset.js +2 -2
  152. package/src/level/tiled/TMXUtils.js +5 -5
  153. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -2
  154. package/src/level/tiled/renderer/TMXIsometricRenderer.js +2 -2
  155. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
  156. package/src/level/tiled/renderer/TMXRenderer.js +19 -19
  157. package/src/loader/loader.js +20 -20
  158. package/src/math/color.js +20 -20
  159. package/src/math/math.js +16 -16
  160. package/src/math/matrix2.js +16 -16
  161. package/src/math/matrix3.js +25 -25
  162. package/src/math/observable_vector2.js +14 -14
  163. package/src/math/observable_vector3.js +16 -16
  164. package/src/math/vector2.js +9 -9
  165. package/src/math/vector3.js +10 -10
  166. package/src/particles/emitter.js +6 -6
  167. package/src/particles/particle.js +2 -2
  168. package/src/physics/body.js +28 -28
  169. package/src/physics/bounds.js +8 -8
  170. package/src/physics/collision.js +2 -2
  171. package/src/physics/detector.js +6 -6
  172. package/src/physics/quadtree.js +11 -11
  173. package/src/physics/sat.js +31 -31
  174. package/src/physics/world.js +5 -5
  175. package/src/plugin/plugin.js +5 -5
  176. package/src/renderable/collectable.js +3 -3
  177. package/src/renderable/colorlayer.js +5 -5
  178. package/src/renderable/container.js +21 -21
  179. package/src/renderable/dragndrop.js +14 -14
  180. package/src/renderable/imagelayer.js +13 -13
  181. package/src/renderable/light2d.js +3 -3
  182. package/src/renderable/nineslicesprite.js +16 -16
  183. package/src/renderable/renderable.js +23 -23
  184. package/src/renderable/sprite.js +28 -28
  185. package/src/renderable/trigger.js +15 -15
  186. package/src/renderable/ui/uibaseelement.js +7 -7
  187. package/src/renderable/ui/uispriteelement.js +6 -6
  188. package/src/renderable/ui/uitextbutton.js +13 -13
  189. package/src/state/stage.js +7 -7
  190. package/src/state/state.js +17 -17
  191. package/src/system/device.js +11 -11
  192. package/src/system/event.js +10 -10
  193. package/src/system/pooling.js +9 -9
  194. package/src/system/save.js +2 -2
  195. package/src/system/timer.js +10 -10
  196. package/src/text/bitmaptext.js +18 -18
  197. package/src/text/bitmaptextdata.js +2 -2
  198. package/src/text/text.js +23 -23
  199. package/src/text/textmetrics.js +8 -8
  200. package/src/tweens/tween.js +19 -19
  201. package/src/utils/agent.js +5 -5
  202. package/src/utils/array.js +4 -4
  203. package/src/utils/file.js +2 -2
  204. package/src/utils/function.js +6 -6
  205. package/src/utils/string.js +5 -5
  206. package/src/utils/utils.js +4 -4
  207. package/src/video/canvas/canvas_renderer.js +70 -70
  208. package/src/video/renderer.js +26 -26
  209. package/src/video/texture/atlas.js +22 -22
  210. package/src/video/texture/canvas_texture.js +9 -9
  211. package/src/video/video.js +17 -17
  212. package/src/video/webgl/glshader.js +10 -10
  213. package/src/video/webgl/webgl_compositor.js +41 -41
  214. package/src/video/webgl/webgl_renderer.js +75 -75
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "melonjs",
3
- "version": "14.0.2",
3
+ "version": "14.1.0",
4
4
  "description": "melonJS Game Engine",
5
5
  "homepage": "http://www.melonjs.org/",
6
6
  "type": "module",
@@ -35,12 +35,14 @@
35
35
  "author": "Olivier Biot (AltByte Pte Ltd)",
36
36
  "funding": "https://github.com/sponsors/melonjs",
37
37
  "engines": {
38
- "node": ">= 16"
38
+ "node": ">= 19"
39
39
  },
40
40
  "main": "dist/melonjs.module.js",
41
- "module": "dist/melonjs.module.js",
41
+ "module": "dist/melonjs.mjs/index.js",
42
42
  "types": "dist/melonjs.module.d.ts",
43
+ "sideEffects": false,
43
44
  "files": [
45
+ "dist/melonjs.mjs",
44
46
  "dist/melonjs.module.js",
45
47
  "dist/melonjs.module.d.ts",
46
48
  "src/",
@@ -51,31 +53,34 @@
51
53
  ],
52
54
  "dependencies": {
53
55
  "@teppeis/multimaps": "^2.0.0",
54
- "core-js": "^3.25.5",
56
+ "core-js": "^3.26.0",
55
57
  "earcut": "2.2.4",
56
58
  "eventemitter3": "^4.0.7",
57
59
  "howler": "2.2.3"
58
60
  },
59
61
  "devDependencies": {
62
+ "@babel/eslint-parser": "^7.19.1",
63
+ "@babel/plugin-syntax-import-assertions": "^7.20.0",
60
64
  "@fastify/static": "^6.5.0",
61
65
  "@melonjs/webdoc-theme": "^1.1.1",
62
- "@rollup/plugin-commonjs": "^23.0.0",
63
- "@rollup/plugin-image": "^2.1.1",
64
- "@rollup/plugin-node-resolve": "^14.1.0",
65
- "@rollup/plugin-replace": "^4.0.0",
66
+ "@rollup/plugin-commonjs": "^23.0.2",
67
+ "@rollup/plugin-image": "^3.0.1",
68
+ "@rollup/plugin-node-resolve": "^15.0.1",
69
+ "@rollup/plugin-replace": "^5.0.1",
66
70
  "@types/offscreencanvas": "^2019.7.0",
67
- "@webdoc/cli": "^2.1.2",
68
- "chromedriver": "^106.0.1",
71
+ "@webdoc/cli": "^2.2.0",
72
+ "chromedriver": "^107.0.1",
69
73
  "cross-env": "^7.0.3",
70
74
  "del-cli": "^5.0.0",
71
- "eslint": "^8.25.0",
72
- "expect": "^29.2.0",
75
+ "eslint": "^8.26.0",
76
+ "eslint-plugin-jsdoc": "^39.3.25",
77
+ "expect": "^29.2.2",
73
78
  "expect-mocha-image-snapshot": "^2.0.14",
74
79
  "fastify": "^4.9.1",
75
80
  "mocha": "^10.1.0",
76
81
  "npm-self-link": "^1.1.7",
77
- "puppeteer": "^19.0.0",
78
- "rollup": "^2.79.1",
82
+ "puppeteer": "^19.2.0",
83
+ "rollup": "^3.2.3",
79
84
  "rollup-plugin-bundle-size": "^1.0.3",
80
85
  "rollup-plugin-string": "^3.0.0",
81
86
  "terser": "^5.15.1",
@@ -83,8 +88,8 @@
83
88
  },
84
89
  "scripts": {
85
90
  "build": "npm run lint && rollup -c --silent",
86
- "dist": " npm run build && mkdirp dist && cp -f build/*.js dist/ && npm run types",
87
- "lint": "eslint src rollup.config.js",
91
+ "dist": " npm run build && mkdirp dist && cp -fR build/*.* dist/ && npm run types",
92
+ "lint": "eslint src/** rollup.config.js",
88
93
  "pretest": "cp -f ./build/melonjs.module.js ./tests/browser/public/lib",
89
94
  "test": "npm run test-node && mocha ./tests/browser/spec/*.js --reporter spec --bail --timeout 10000",
90
95
  "test-node": "node build/melonjs.module.js",
@@ -93,7 +98,7 @@
93
98
  "doc": "npm run doc-prod",
94
99
  "serve": "python3 -m http.server",
95
100
  "prepublishOnly": "npm run dist && npm run test",
96
- "clean": "del-cli --force build/*.js dist/*.js dist/*.d.ts docs src/**/*.d.ts",
101
+ "clean": "del-cli --force build/*.* dist/*.* docs",
97
102
  "types": "tsc src/index.js --declaration --allowJs --emitDeclarationOnly --outfile dist/melonjs.module.d.ts"
98
103
  }
99
104
  }
@@ -157,8 +157,8 @@ class Application {
157
157
 
158
158
  /**
159
159
  * update all objects related to this game active scene/stage
160
- * @param {number} time current timestamp as provided by the RAF callback
161
- * @param {Stage} stage the current stage
160
+ * @param {number} time - current timestamp as provided by the RAF callback
161
+ * @param {Stage} stage - the current stage
162
162
  */
163
163
  update(time, stage) {
164
164
  // handle frame skipping if required
@@ -203,7 +203,7 @@ class Application {
203
203
 
204
204
  /**
205
205
  * draw the active scene/stage associated to this game
206
- * @param {Stage} stage the current stage
206
+ * @param {Stage} stage - the current stage
207
207
  */
208
208
  draw(stage) {
209
209
  if (renderer.isContextValid === true && (this.isDirty || this.isAlwaysDirty)) {
@@ -84,7 +84,7 @@ export let stopOnAudioError = true;
84
84
  * It is important to remember that melonJS selects the first compatible sound based on the list of extensions and given order passed here.
85
85
  * So if you want webm to be used before mp3, you need to put the audio format in that order.
86
86
  * @function audio.init
87
- * @param {string} [format="mp3"] audio format to prioritize
87
+ * @param {string} [format="mp3"] - audio format to prioritize
88
88
  * @returns {boolean} Indicates whether audio initialization was successful
89
89
  * @example
90
90
  * // initialize the "sound engine", giving "webm" as default desired audio format, and "mp3" as a fallback
@@ -103,7 +103,7 @@ export let stopOnAudioError = true;
103
103
  /**
104
104
  * check if the given audio format is supported
105
105
  * @function audio.hasFormat
106
- * @param {string} codec audio format : "mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "m4b", "mp4", "weba", "webm", "dolby", "flac"
106
+ * @param {string} codec - audio format : "mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "m4b", "mp4", "weba", "webm", "dolby", "flac"
107
107
  * @returns {boolean} return true if the given audio format is supported
108
108
  */
109
109
  export function hasFormat(codec) {
@@ -186,10 +186,10 @@ export function load(sound, html5, onload_cb, onerror_cb) {
186
186
  /**
187
187
  * play the specified sound
188
188
  * @function audio.play
189
- * @param {string} sound_name audio clip name - case sensitive
190
- * @param {boolean} [loop=false] loop audio
191
- * @param {Function} [onend] Function to call when sound instance ends playing.
192
- * @param {number} [volume=default] Float specifying volume (0.0 - 1.0 values accepted).
189
+ * @param {string} sound_name - audio clip name - case sensitive
190
+ * @param {boolean} [loop=false] - loop audio
191
+ * @param {Function} [onend] - Function to call when sound instance ends playing.
192
+ * @param {number} [volume=default] - Float specifying volume (0.0 - 1.0 values accepted).
193
193
  * @returns {number} the sound instance ID.
194
194
  * @example
195
195
  * // play the "cling" audio clip
@@ -227,11 +227,11 @@ export function play(sound_name, loop = false, onend, volume) {
227
227
  /**
228
228
  * Fade a currently playing sound between two volumee.
229
229
  * @function audio.fade
230
- * @param {string} sound_name audio clip name - case sensitive
231
- * @param {number} from Volume to fade from (0.0 to 1.0).
232
- * @param {number} to Volume to fade to (0.0 to 1.0).
233
- * @param {number} duration Time in milliseconds to fade.
234
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will fade.
230
+ * @param {string} sound_name - audio clip name - case sensitive
231
+ * @param {number} from - Volume to fade from (0.0 to 1.0).
232
+ * @param {number} to - Volume to fade to (0.0 to 1.0).
233
+ * @param {number} duration - Time in milliseconds to fade.
234
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will fade.
235
235
  */
236
236
  export function fade(sound_name, from, to, duration, id) {
237
237
  var sound = audioTracks[sound_name];
@@ -245,9 +245,9 @@ export function fade(sound_name, from, to, duration, id) {
245
245
  /**
246
246
  * get/set the position of playback for a sound.
247
247
  * @function audio.seek
248
- * @param {string} sound_name audio clip name - case sensitive
249
- * @param {number} [seek] the position to move current playback to (in seconds).
250
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will changed.
248
+ * @param {string} sound_name - audio clip name - case sensitive
249
+ * @param {number} [seek] - the position to move current playback to (in seconds).
250
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will changed.
251
251
  * @returns {number} return the current seek position (if no extra parameters were given)
252
252
  * @example
253
253
  * // return the current position of the background music
@@ -267,9 +267,9 @@ export function seek(sound_name, ...args) {
267
267
  /**
268
268
  * get or set the rate of playback for a sound.
269
269
  * @function audio.rate
270
- * @param {string} sound_name audio clip name - case sensitive
271
- * @param {number} [rate] playback rate : 0.5 to 4.0, with 1.0 being normal speed.
272
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will be changed.
270
+ * @param {string} sound_name - audio clip name - case sensitive
271
+ * @param {number} [rate] - playback rate : 0.5 to 4.0, with 1.0 being normal speed.
272
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
273
273
  * @returns {number} return the current playback rate (if no extra parameters were given)
274
274
  * @example
275
275
  * // get the playback rate of the background music
@@ -289,8 +289,8 @@ export function rate(sound_name, ...args) {
289
289
  /**
290
290
  * stop the specified sound on all channels
291
291
  * @function audio.stop
292
- * @param {string} [sound_name] audio clip name (case sensitive). If none is passed, all sounds are stopped.
293
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will stop.
292
+ * @param {string} [sound_name] - audio clip name (case sensitive). If none is passed, all sounds are stopped.
293
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will stop.
294
294
  * @example
295
295
  * me.audio.stop("cling");
296
296
  */
@@ -313,8 +313,8 @@ export function stop(sound_name, id) {
313
313
  * pause the specified sound on all channels<br>
314
314
  * this function does not reset the currentTime property
315
315
  * @function audio.pause
316
- * @param {string} sound_name audio clip name - case sensitive
317
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will pause.
316
+ * @param {string} sound_name - audio clip name - case sensitive
317
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will pause.
318
318
  * @example
319
319
  * me.audio.pause("cling");
320
320
  */
@@ -330,8 +330,8 @@ export function pause(sound_name, id) {
330
330
  /**
331
331
  * resume the specified sound on all channels<br>
332
332
  * @function audio.resume
333
- * @param {string} sound_name audio clip name - case sensitive
334
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will resume.
333
+ * @param {string} sound_name - audio clip name - case sensitive
334
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will resume.
335
335
  * @example
336
336
  * // play a audio clip
337
337
  * var id = me.audio.play("myClip");
@@ -356,8 +356,8 @@ export function resume(sound_name, id) {
356
356
  * this function automatically set the loop property to true<br>
357
357
  * and keep track of the current sound being played.
358
358
  * @function audio.playTrack
359
- * @param {string} sound_name audio track name - case sensitive
360
- * @param {number} [volume=default] Float specifying volume (0.0 - 1.0 values accepted).
359
+ * @param {string} sound_name - audio track name - case sensitive
360
+ * @param {number} [volume=default] - Float specifying volume (0.0 - 1.0 values accepted).
361
361
  * @returns {number} the sound instance ID.
362
362
  * @example
363
363
  * me.audio.playTrack("awesome_music");
@@ -430,7 +430,7 @@ export function getCurrentTrack() {
430
430
  /**
431
431
  * set the default global volume
432
432
  * @function audio.setVolume
433
- * @param {number} volume Float specifying volume (0.0 - 1.0 values accepted).
433
+ * @param {number} volume - Float specifying volume (0.0 - 1.0 values accepted).
434
434
  */
435
435
  export function setVolume(volume) {
436
436
  Howler.volume(volume);
@@ -448,9 +448,9 @@ export function getVolume() {
448
448
  /**
449
449
  * mute or unmute the specified sound, but does not pause the playback.
450
450
  * @function audio.mute
451
- * @param {string} sound_name audio clip name - case sensitive
452
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will mute.
453
- * @param {boolean} [mute=true] True to mute and false to unmute
451
+ * @param {string} sound_name - audio clip name - case sensitive
452
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will mute.
453
+ * @param {boolean} [mute=true] - True to mute and false to unmute
454
454
  * @example
455
455
  * // mute the background music
456
456
  * me.audio.mute("awesome_music");
@@ -469,8 +469,8 @@ export function mute(sound_name, id, mute) {
469
469
  /**
470
470
  * unmute the specified sound
471
471
  * @function audio.unmute
472
- * @param {string} sound_name audio clip name
473
- * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will unmute.
472
+ * @param {string} sound_name - audio clip name
473
+ * @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will unmute.
474
474
  */
475
475
  export function unmute(sound_name, id) {
476
476
  mute(sound_name, id, false);
@@ -504,7 +504,7 @@ export function muted() {
504
504
  /**
505
505
  * unload specified audio track to free memory
506
506
  * @function audio.unload
507
- * @param {string} sound_name audio track name - case sensitive
507
+ * @param {string} sound_name - audio track name - case sensitive
508
508
  * @returns {boolean} true if unloaded
509
509
  * @example
510
510
  * me.audio.unload("awesome_music");
@@ -25,10 +25,10 @@ var targetV = new Vector2d();
25
25
  */
26
26
  class Camera2d extends Renderable {
27
27
  /**
28
- * @param {number} minX start x offset
29
- * @param {number} minY start y offset
30
- * @param {number} maxX end x offset
31
- * @param {number} maxY end y offset
28
+ * @param {number} minX - start x offset
29
+ * @param {number} minY - start y offset
30
+ * @param {number} maxX - end x offset
31
+ * @param {number} maxY - end y offset
32
32
  */
33
33
  constructor(minX, minY, maxX, maxY) {
34
34
  super(minX, minY, maxX - minX, maxY - minY);
@@ -237,8 +237,8 @@ class Camera2d extends Renderable {
237
237
  * @name setDeadzone
238
238
  * @see Camera2d.follow
239
239
  * @memberof Camera2d
240
- * @param {number} w deadzone width
241
- * @param {number} h deadzone height
240
+ * @param {number} w - deadzone width
241
+ * @param {number} h - deadzone height
242
242
  */
243
243
  setDeadzone(w, h) {
244
244
  if (typeof(this.deadzone) === "undefined") {
@@ -264,8 +264,8 @@ class Camera2d extends Renderable {
264
264
  * resize the camera
265
265
  * @name resize
266
266
  * @memberof Camera2d
267
- * @param {number} w new width of the camera
268
- * @param {number} h new height of the camera
267
+ * @param {number} w - new width of the camera
268
+ * @param {number} h - new height of the camera
269
269
  * @returns {Camera2d} this camera
270
270
  */
271
271
  resize(w, h) {
@@ -295,10 +295,10 @@ class Camera2d extends Renderable {
295
295
  * the camera is bound to the given coordinates and cannot move/be scrolled outside of it.
296
296
  * @name setBounds
297
297
  * @memberof Camera2d
298
- * @param {number} x world left limit
299
- * @param {number} y world top limit
300
- * @param {number} w world width limit
301
- * @param {number} h world height limit
298
+ * @param {number} x - world left limit
299
+ * @param {number} y - world top limit
300
+ * @param {number} w - world width limit
301
+ * @param {number} h - world height limit
302
302
  */
303
303
  setBounds(x, y, w, h) {
304
304
  this.smoothFollow = false;
@@ -313,9 +313,9 @@ class Camera2d extends Renderable {
313
313
  * (this will put the camera center around the given target)
314
314
  * @name follow
315
315
  * @memberof Camera2d
316
- * @param {Renderable|Vector2d} target renderable or position vector to follow
317
- * @param {number} [axis=me.game.viewport.AXIS.BOTH] Which axis to follow (see {@link Camera2d.AXIS})
318
- * @param {number} [damping=1] default damping value
316
+ * @param {Renderable|Vector2d} target - renderable or position vector to follow
317
+ * @param {number} [axis=me.game.viewport.AXIS.BOTH] - Which axis to follow (see {@link Camera2d.AXIS})
318
+ * @param {number} [damping=1] - default damping value
319
319
  * @example
320
320
  * // set the camera to follow this renderable on both axis, and enable damping
321
321
  * me.game.viewport.follow(this, me.game.viewport.AXIS.BOTH, 0.1);
@@ -503,12 +503,12 @@ class Camera2d extends Renderable {
503
503
  * shake the camera
504
504
  * @name shake
505
505
  * @memberof Camera2d
506
- * @param {number} intensity maximum offset that the screen can be moved
506
+ * @param {number} intensity - maximum offset that the screen can be moved
507
507
  * while shaking
508
- * @param {number} duration expressed in milliseconds
509
- * @param {number} [axis=me.game.viewport.AXIS.BOTH] specify on which axis to apply the shake effect (see {@link Camera2d.AXIS})
510
- * @param {Function} [onComplete] callback once shaking effect is over
511
- * @param {boolean} [force] if true this will override the current effect
508
+ * @param {number} duration - expressed in milliseconds
509
+ * @param {number} [axis=me.game.viewport.AXIS.BOTH] - specify on which axis to apply the shake effect (see {@link Camera2d.AXIS})
510
+ * @param {Function} [onComplete] - callback once shaking effect is over
511
+ * @param {boolean} [force] - if true this will override the current effect
512
512
  * @example
513
513
  * // shake it baby !
514
514
  * me.game.viewport.shake(10, 500, me.game.viewport.AXIS.BOTH);
@@ -527,9 +527,9 @@ class Camera2d extends Renderable {
527
527
  * screen is filled with the specified color and slowly goes back to normal
528
528
  * @name fadeOut
529
529
  * @memberof Camera2d
530
- * @param {Color|string} color a CSS color value
531
- * @param {number} [duration=1000] expressed in milliseconds
532
- * @param {Function} [onComplete] callback once effect is over
530
+ * @param {Color|string} color - a CSS color value
531
+ * @param {number} [duration=1000] - expressed in milliseconds
532
+ * @param {Function} [onComplete] - callback once effect is over
533
533
  * @example
534
534
  * // fade the camera to white upon dying, reload the level, and then fade out back
535
535
  * me.game.viewport.fadeIn("#fff", 150, function() {
@@ -552,9 +552,9 @@ class Camera2d extends Renderable {
552
552
  * fade to the specified color
553
553
  * @name fadeIn
554
554
  * @memberof Camera2d
555
- * @param {Color|string} color a CSS color value
556
- * @param {number} [duration=1000] expressed in milliseconds
557
- * @param {Function} [onComplete] callback once effect is over
555
+ * @param {Color|string} color - a CSS color value
556
+ * @param {number} [duration=1000] - expressed in milliseconds
557
+ * @param {Function} [onComplete] - callback once effect is over
558
558
  * @example
559
559
  * // flash the camera to white for 75ms
560
560
  * me.game.viewport.fadeIn("#FFFFFF", 75);
@@ -574,7 +574,7 @@ class Camera2d extends Renderable {
574
574
  * set the camera position around the specified object
575
575
  * @name focusOn
576
576
  * @memberof Camera2d
577
- * @param {Renderable} target the renderable to focus the camera on
577
+ * @param {Renderable} target - the renderable to focus the camera on
578
578
  */
579
579
  focusOn(target) {
580
580
  var bounds = target.getBounds();
@@ -588,8 +588,8 @@ class Camera2d extends Renderable {
588
588
  * check if the specified renderable is in the camera
589
589
  * @name isVisible
590
590
  * @memberof Camera2d
591
- * @param {Renderable} obj to be checked against
592
- * @param {boolean} [floating = obj.floating] if visibility check should be done against screen coordinates
591
+ * @param {Renderable} obj - to be checked against
592
+ * @param {boolean} [floating = obj.floating] - if visibility check should be done against screen coordinates
593
593
  * @returns {boolean}
594
594
  */
595
595
  isVisible(obj, floating = obj.floating) {
@@ -608,7 +608,7 @@ class Camera2d extends Renderable {
608
608
  * @memberof Camera2d
609
609
  * @param {number} x
610
610
  * @param {number} y
611
- * @param {number} [v] an optional vector object where to set the
611
+ * @param {number} [v] - an optional vector object where to set the
612
612
  * converted value
613
613
  * @returns {Vector2d}
614
614
  */
@@ -628,7 +628,7 @@ class Camera2d extends Renderable {
628
628
  * @memberof Camera2d
629
629
  * @param {number} x
630
630
  * @param {number} y
631
- * @param {number} [v] an optional vector object where to set the
631
+ * @param {number} [v] - an optional vector object where to set the
632
632
  * converted value
633
633
  * @returns {Vector2d}
634
634
  */
@@ -12,21 +12,21 @@ import Body from "./../physics/body.js";
12
12
  */
13
13
  class Entity extends Renderable {
14
14
  /**
15
- * @param {number} x the x coordinates of the entity object
16
- * @param {number} y the y coordinates of the entity object
17
- * @param {object} settings Entity properties, to be defined through Tiled or when calling the entity constructor
15
+ * @param {number} x - the x coordinates of the entity object
16
+ * @param {number} y - the y coordinates of the entity object
17
+ * @param {object} settings - Entity properties, to be defined through Tiled or when calling the entity constructor
18
18
  * <img src="images/object_properties.png"/>
19
- * @param {number} settings.width the physical width the entity takes up in game
20
- * @param {number} settings.height the physical height the entity takes up in game
21
- * @param {string} [settings.name] object entity name
22
- * @param {string} [settings.id] object unique IDs
23
- * @param {Image|string} [settings.image] resource name of a spritesheet to use for the entity renderable component
24
- * @param {Vector2d} [settings.anchorPoint=0.0] Entity anchor point
25
- * @param {number} [settings.framewidth=settings.width] width of a single frame in the given spritesheet
26
- * @param {number} [settings.frameheight=settings.width] height of a single frame in the given spritesheet
27
- * @param {string} [settings.type] object type
28
- * @param {number} [settings.collisionMask] Mask collision detection for this object
29
- * @param {Rect[]|Polygon[]|Line[]|Ellipse[]} [settings.shapes] the initial list of collision shapes (usually populated through Tiled)
19
+ * @param {number} settings.width - the physical width the entity takes up in game
20
+ * @param {number} settings.height - the physical height the entity takes up in game
21
+ * @param {string} [settings.name] - object entity name
22
+ * @param {string} [settings.id] - object unique IDs
23
+ * @param {Image|string} [settings.image] - resource name of a spritesheet to use for the entity renderable component
24
+ * @param {Vector2d} [settings.anchorPoint=0.0] - Entity anchor point
25
+ * @param {number} [settings.framewidth=settings.width] - width of a single frame in the given spritesheet
26
+ * @param {number} [settings.frameheight=settings.width] - height of a single frame in the given spritesheet
27
+ * @param {string} [settings.type] - object type
28
+ * @param {number} [settings.collisionMask] - Mask collision detection for this object
29
+ * @param {Rect[]|Polygon[]|Line[]|Ellipse[]} [settings.shapes] - the initial list of collision shapes (usually populated through Tiled)
30
30
  */
31
31
  constructor(x, y, settings) {
32
32
 
@@ -158,7 +158,7 @@ class Entity extends Renderable {
158
158
  * @ignore
159
159
  * @name onBodyUpdate
160
160
  * @memberof Entity
161
- * @param {Body} body the body whose bounds to update
161
+ * @param {Body} body - the body whose bounds to update
162
162
  */
163
163
  onBodyUpdate(body) {
164
164
  // update the entity bounds to include the body bounds
@@ -192,8 +192,8 @@ class Entity extends Renderable {
192
192
  * @name draw
193
193
  * @memberof Entity
194
194
  * @protected
195
- * @param {CanvasRenderer|WebGLRenderer} renderer a renderer instance
196
- * @param {Camera2d} [viewport] the viewport to (re)draw
195
+ * @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
196
+ * @param {Camera2d} [viewport] - the viewport to (re)draw
197
197
  */
198
198
  draw(renderer, viewport) {
199
199
  var renderable = this.renderable;
@@ -6,10 +6,10 @@ import pool from "./../system/pooling.js";
6
6
  */
7
7
  class Ellipse {
8
8
  /**
9
- * @param {number} x the center x coordinate of the ellipse
10
- * @param {number} y the center y coordinate of the ellipse
11
- * @param {number} w width (diameter) of the ellipse
12
- * @param {number} h height (diameter) of the ellipse
9
+ * @param {number} x - the center x coordinate of the ellipse
10
+ * @param {number} y - the center y coordinate of the ellipse
11
+ * @param {number} w - width (diameter) of the ellipse
12
+ * @param {number} h - height (diameter) of the ellipse
13
13
  */
14
14
  constructor(x, y, w, h) {
15
15
  /**
@@ -77,10 +77,10 @@ class Ellipse {
77
77
  * set new value to the Ellipse shape
78
78
  * @name setShape
79
79
  * @memberof Ellipse
80
- * @param {number} x the center x coordinate of the ellipse
81
- * @param {number} y the center y coordinate of the ellipse
82
- * @param {number} w width (diameter) of the ellipse
83
- * @param {number} h height (diameter) of the ellipse
80
+ * @param {number} x - the center x coordinate of the ellipse
81
+ * @param {number} y - the center y coordinate of the ellipse
82
+ * @param {number} w - width (diameter) of the ellipse
83
+ * @param {number} h - height (diameter) of the ellipse
84
84
  * @returns {Ellipse} this instance for objecf chaining
85
85
  */
86
86
  setShape(x, y, w, h) {
@@ -106,8 +106,8 @@ class Ellipse {
106
106
  * Rotate this Ellipse (counter-clockwise) by the specified angle (in radians).
107
107
  * @name rotate
108
108
  * @memberof Ellipse
109
- * @param {number} angle The angle to rotate (in radians)
110
- * @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
109
+ * @param {number} angle - The angle to rotate (in radians)
110
+ * @param {Vector2d|ObservableVector2d} [v] - an optional point to rotate around
111
111
  * @returns {Ellipse} Reference to this object for method chaining
112
112
  */
113
113
  rotate(angle, v) {
@@ -151,7 +151,7 @@ class Ellipse {
151
151
  * apply the given transformation matrix to this ellipse
152
152
  * @name transform
153
153
  * @memberof Ellipse
154
- * @param {Matrix2d} matrix the transformation matrix
154
+ * @param {Matrix2d} matrix - the transformation matrix
155
155
  * @returns {Polygon} Reference to this object for method chaining
156
156
  */
157
157
  transform(matrix) { // eslint-disable-line no-unused-vars
@@ -164,15 +164,15 @@ class Ellipse {
164
164
  * @name translate
165
165
  * @memberof Ellipse
166
166
  * @method
167
- * @param {number} x x offset
168
- * @param {number} y y offset
167
+ * @param {number} x - x offset
168
+ * @param {number} y - y offset
169
169
  * @returns {Ellipse} this ellipse
170
170
  */
171
171
  /**
172
172
  * translate the circle/ellipse by the specified vector
173
173
  * @name translate
174
174
  * @memberof Ellipse
175
- * @param {Vector2d} v vector offset
175
+ * @param {Vector2d} v - vector offset
176
176
  * @returns {Ellipse} this ellipse
177
177
  */
178
178
  translate() {
@@ -208,8 +208,8 @@ class Ellipse {
208
208
  * check if this circle/ellipse contains the specified point
209
209
  * @name contains
210
210
  * @memberof Ellipse
211
- * @param {number} x x coordinate
212
- * @param {number} y y coordinate
211
+ * @param {number} x - x coordinate
212
+ * @param {number} y - y coordinate
213
213
  * @returns {boolean} true if contains
214
214
  */
215
215
  contains() {
@@ -5,9 +5,9 @@ import Polygon from "./poly.js";
5
5
  * @classdesc
6
6
  * a line segment Object
7
7
  * @augments Polygon
8
- * @param {number} x origin point of the Line
9
- * @param {number} y origin point of the Line
10
- * @param {Vector2d[]} points array of vectors defining the Line
8
+ * @param {number} x - origin point of the Line
9
+ * @param {number} y - origin point of the Line
10
+ * @param {Vector2d[]} points - array of vectors defining the Line
11
11
  */
12
12
 
13
13
  class Line extends Polygon {
@@ -25,8 +25,8 @@ class Line extends Polygon {
25
25
  * Returns true if the Line contains the given point
26
26
  * @name contains
27
27
  * @memberof Line
28
- * @param {number} x x coordinate
29
- * @param {number} y y coordinate
28
+ * @param {number} x - x coordinate
29
+ * @param {number} y - y coordinate
30
30
  * @returns {boolean} true if contains
31
31
  */
32
32
  contains() {