melonjs 14.2.0 → 14.4.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 (388) hide show
  1. package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +2 -2
  2. package/dist/melonjs.mjs/_virtual/arraymultimap.js +2 -2
  3. package/dist/melonjs.mjs/_virtual/earcut.js +2 -2
  4. package/dist/melonjs.mjs/_virtual/howler.js +2 -2
  5. package/dist/melonjs.mjs/_virtual/index.js +2 -2
  6. package/dist/melonjs.mjs/_virtual/index2.js +2 -2
  7. package/dist/melonjs.mjs/_virtual/multimap.js +2 -2
  8. package/dist/melonjs.mjs/_virtual/setmultimap.js +2 -2
  9. package/dist/melonjs.mjs/application/application.js +141 -10
  10. package/dist/melonjs.mjs/application/header.js +34 -0
  11. package/dist/melonjs.mjs/application/resize.js +4 -2
  12. package/dist/melonjs.mjs/application/settings.js +28 -0
  13. package/dist/melonjs.mjs/audio/audio.js +2 -2
  14. package/dist/melonjs.mjs/camera/camera2d.js +3 -3
  15. package/dist/melonjs.mjs/const.js +32 -0
  16. package/dist/melonjs.mjs/entity/entity.js +2 -2
  17. package/dist/melonjs.mjs/game.js +1 -1
  18. package/dist/melonjs.mjs/geometries/ellipse.js +2 -2
  19. package/dist/melonjs.mjs/geometries/line.js +2 -2
  20. package/dist/melonjs.mjs/geometries/path2d.js +2 -2
  21. package/dist/melonjs.mjs/geometries/point.js +2 -2
  22. package/dist/melonjs.mjs/geometries/poly.js +2 -2
  23. package/dist/melonjs.mjs/geometries/rectangle.js +2 -2
  24. package/dist/melonjs.mjs/geometries/roundrect.js +2 -2
  25. package/dist/melonjs.mjs/index.js +44 -33
  26. package/dist/melonjs.mjs/input/gamepad.js +2 -2
  27. package/dist/melonjs.mjs/input/input.js +2 -2
  28. package/dist/melonjs.mjs/input/keyboard.js +2 -2
  29. package/dist/melonjs.mjs/input/pointer.js +3 -3
  30. package/dist/melonjs.mjs/input/pointerevent.js +3 -3
  31. package/dist/melonjs.mjs/lang/console.js +44 -0
  32. package/dist/melonjs.mjs/lang/deprecated.js +4 -40
  33. package/dist/melonjs.mjs/level/level.js +3 -3
  34. package/dist/melonjs.mjs/level/tiled/TMXGroup.js +2 -23
  35. package/dist/melonjs.mjs/level/tiled/TMXLayer.js +68 -58
  36. package/dist/melonjs.mjs/level/tiled/TMXObject.js +2 -64
  37. package/dist/melonjs.mjs/level/tiled/TMXTile.js +10 -26
  38. package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +18 -84
  39. package/dist/melonjs.mjs/level/tiled/TMXTileset.js +2 -16
  40. package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +3 -10
  41. package/dist/melonjs.mjs/level/tiled/TMXUtils.js +37 -14
  42. package/dist/melonjs.mjs/level/tiled/constants.js +17 -0
  43. package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +7 -8
  44. package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +3 -6
  45. package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -2
  46. package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +2 -14
  47. package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +2 -2
  48. package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +38 -0
  49. package/dist/melonjs.mjs/loader/loader.js +5 -3
  50. package/dist/melonjs.mjs/loader/loadingscreen.js +3 -3
  51. package/dist/melonjs.mjs/loader/melonjs_logo.png.js +2 -2
  52. package/dist/melonjs.mjs/math/color.js +2 -2
  53. package/dist/melonjs.mjs/math/math.js +2 -2
  54. package/dist/melonjs.mjs/math/matrix2.js +2 -2
  55. package/dist/melonjs.mjs/math/matrix3.js +2 -2
  56. package/dist/melonjs.mjs/math/observable_vector2.js +2 -2
  57. package/dist/melonjs.mjs/math/observable_vector3.js +2 -2
  58. package/dist/melonjs.mjs/math/vector2.js +2 -2
  59. package/dist/melonjs.mjs/math/vector3.js +2 -2
  60. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +2 -2
  61. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +2 -2
  62. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +2 -2
  63. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +2 -2
  64. package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +2 -2
  65. package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +2 -2
  66. package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +2 -2
  67. package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +2 -2
  68. package/dist/melonjs.mjs/particles/emitter.js +2 -2
  69. package/dist/melonjs.mjs/particles/particle.js +2 -2
  70. package/dist/melonjs.mjs/particles/settings.js +2 -2
  71. package/dist/melonjs.mjs/physics/body.js +2 -2
  72. package/dist/melonjs.mjs/physics/bounds.js +2 -2
  73. package/dist/melonjs.mjs/physics/collision.js +4 -4
  74. package/dist/melonjs.mjs/physics/detector.js +175 -147
  75. package/dist/melonjs.mjs/physics/quadtree.js +2 -2
  76. package/dist/melonjs.mjs/physics/response.js +2 -2
  77. package/dist/melonjs.mjs/physics/sat.js +2 -2
  78. package/dist/melonjs.mjs/physics/world.js +11 -31
  79. package/dist/melonjs.mjs/plugin/plugin.js +4 -4
  80. package/dist/melonjs.mjs/renderable/collectable.js +2 -2
  81. package/dist/melonjs.mjs/renderable/colorlayer.js +2 -2
  82. package/dist/melonjs.mjs/renderable/container.js +4 -88
  83. package/dist/melonjs.mjs/renderable/dragndrop.js +2 -2
  84. package/dist/melonjs.mjs/renderable/imagelayer.js +3 -3
  85. package/dist/melonjs.mjs/renderable/light2d.js +2 -2
  86. package/dist/melonjs.mjs/renderable/nineslicesprite.js +2 -2
  87. package/dist/melonjs.mjs/renderable/renderable.js +2 -2
  88. package/dist/melonjs.mjs/renderable/sprite.js +2 -2
  89. package/dist/melonjs.mjs/renderable/trigger.js +3 -3
  90. package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +2 -2
  91. package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +2 -2
  92. package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +2 -2
  93. package/dist/melonjs.mjs/state/stage.js +3 -3
  94. package/dist/melonjs.mjs/state/state.js +3 -3
  95. package/dist/melonjs.mjs/system/device.js +3 -23
  96. package/dist/melonjs.mjs/system/dom.js +2 -2
  97. package/dist/melonjs.mjs/system/event.js +2 -2
  98. package/dist/melonjs.mjs/system/platform.js +2 -2
  99. package/dist/melonjs.mjs/system/pooling.js +2 -2
  100. package/dist/melonjs.mjs/system/save.js +2 -2
  101. package/dist/melonjs.mjs/system/timer.js +2 -2
  102. package/dist/melonjs.mjs/text/bitmaptext.js +2 -2
  103. package/dist/melonjs.mjs/text/bitmaptextdata.js +2 -2
  104. package/dist/melonjs.mjs/text/glyph.js +2 -2
  105. package/dist/melonjs.mjs/text/text.js +2 -2
  106. package/dist/melonjs.mjs/text/textmetrics.js +2 -2
  107. package/dist/melonjs.mjs/text/textstyle.js +2 -2
  108. package/dist/melonjs.mjs/tweens/easing.js +2 -2
  109. package/dist/melonjs.mjs/tweens/interpolation.js +2 -2
  110. package/dist/melonjs.mjs/tweens/tween.js +3 -3
  111. package/dist/melonjs.mjs/utils/agent.js +2 -2
  112. package/dist/melonjs.mjs/utils/array.js +2 -2
  113. package/dist/melonjs.mjs/utils/file.js +2 -2
  114. package/dist/melonjs.mjs/utils/function.js +2 -2
  115. package/dist/melonjs.mjs/utils/string.js +2 -2
  116. package/dist/melonjs.mjs/utils/utils.js +2 -2
  117. package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +5 -2
  118. package/dist/melonjs.mjs/video/renderer.js +9 -2
  119. package/dist/melonjs.mjs/video/texture/atlas.js +2 -2
  120. package/dist/melonjs.mjs/video/texture/cache.js +2 -2
  121. package/dist/melonjs.mjs/video/texture/canvas_texture.js +4 -3
  122. package/dist/melonjs.mjs/video/utils/autodetect.js +27 -0
  123. package/dist/melonjs.mjs/video/utils/resize.js +1 -1
  124. package/dist/melonjs.mjs/video/video.js +29 -158
  125. package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +2 -2
  126. package/dist/melonjs.mjs/video/webgl/glshader.js +3 -4
  127. package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +2 -2
  128. package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +2 -2
  129. package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +2 -2
  130. package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +2 -2
  131. package/dist/melonjs.mjs/video/webgl/utils/attributes.js +2 -2
  132. package/dist/melonjs.mjs/video/webgl/utils/precision.js +21 -3
  133. package/dist/melonjs.mjs/video/webgl/utils/program.js +2 -2
  134. package/dist/melonjs.mjs/video/webgl/utils/string.js +2 -2
  135. package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +2 -2
  136. package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +2 -2
  137. package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +5 -2
  138. package/dist/melonjs.module.js +20845 -20968
  139. package/dist/types/application/application.d.ts +148 -0
  140. package/dist/types/application/header.d.ts +5 -0
  141. package/dist/types/application/resize.d.ts +6 -0
  142. package/dist/types/application/settings.d.ts +18 -0
  143. package/dist/types/audio/audio.d.ts +267 -0
  144. package/dist/types/camera/camera2d.d.ts +289 -0
  145. package/dist/types/const.d.ts +21 -0
  146. package/dist/types/entity/entity.d.ts +98 -0
  147. package/{src/game.js → dist/types/game.d.ts} +3 -14
  148. package/dist/types/geometries/ellipse.d.ts +154 -0
  149. package/dist/types/geometries/line.d.ts +11 -0
  150. package/dist/types/geometries/path2d.d.ts +121 -0
  151. package/dist/types/geometries/point.d.ts +53 -0
  152. package/dist/types/geometries/poly.d.ts +222 -0
  153. package/dist/types/geometries/rectangle.d.ts +176 -0
  154. package/dist/types/geometries/roundrect.d.ts +52 -0
  155. package/dist/types/index.d.ts +4 -2
  156. package/dist/types/input/gamepad.d.ts +95 -0
  157. package/dist/types/input/input.d.ts +15 -0
  158. package/dist/types/input/keyboard.d.ts +205 -0
  159. package/dist/types/input/pointer.d.ts +270 -0
  160. package/dist/types/input/pointerevent.d.ts +181 -0
  161. package/dist/types/lang/console.d.ts +7 -0
  162. package/dist/types/lang/deprecated.d.ts +45 -0
  163. package/dist/types/level/level.d.ts +134 -0
  164. package/dist/types/level/tiled/TMXGroup.d.ts +61 -0
  165. package/dist/types/level/tiled/TMXLayer.d.ts +158 -0
  166. package/dist/types/level/tiled/TMXObject.d.ts +133 -0
  167. package/dist/types/level/tiled/TMXTile.d.ts +64 -0
  168. package/dist/types/level/tiled/TMXTileMap.d.ts +142 -0
  169. package/dist/types/level/tiled/TMXTileset.d.ts +80 -0
  170. package/dist/types/level/tiled/TMXTilesetGroup.d.ts +26 -0
  171. package/dist/types/level/tiled/TMXUtils.d.ts +47 -0
  172. package/dist/types/level/tiled/constants.d.ts +5 -0
  173. package/dist/types/level/tiled/renderer/TMXHexagonalRenderer.d.ts +83 -0
  174. package/dist/types/level/tiled/renderer/TMXIsometricRenderer.d.ts +51 -0
  175. package/dist/types/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +43 -0
  176. package/dist/types/level/tiled/renderer/TMXRenderer.d.ts +63 -0
  177. package/dist/types/level/tiled/renderer/TMXStaggeredRenderer.d.ts +8 -0
  178. package/dist/types/level/tiled/renderer/autodetect.d.ts +9 -0
  179. package/dist/types/loader/loader.d.ts +181 -0
  180. package/dist/types/loader/loadingscreen.d.ts +18 -0
  181. package/dist/types/math/color.d.ts +170 -0
  182. package/dist/types/math/math.d.ts +165 -0
  183. package/dist/types/math/matrix2.d.ts +209 -0
  184. package/dist/types/math/matrix3.d.ts +236 -0
  185. package/dist/types/math/observable_vector2.d.ts +278 -0
  186. package/dist/types/math/observable_vector3.d.ts +277 -0
  187. package/dist/types/math/vector2.d.ts +327 -0
  188. package/dist/types/math/vector3.d.ts +332 -0
  189. package/dist/types/particles/emitter.d.ts +188 -0
  190. package/dist/types/particles/particle.d.ts +32 -0
  191. package/dist/types/particles/settings.d.ts +32 -0
  192. package/dist/types/physics/body.d.ts +330 -0
  193. package/dist/types/physics/bounds.d.ts +250 -0
  194. package/dist/types/physics/collision.d.ts +44 -0
  195. package/dist/types/physics/detector.d.ts +64 -0
  196. package/dist/types/physics/quadtree.d.ts +79 -0
  197. package/dist/types/physics/response.d.ts +37 -0
  198. package/dist/types/physics/sat.d.ts +48 -0
  199. package/dist/types/physics/world.d.ts +83 -0
  200. package/dist/types/plugin/plugin.d.ts +10 -0
  201. package/dist/types/polyfill/console.d.ts +0 -0
  202. package/dist/types/polyfill/index.d.ts +1 -0
  203. package/dist/types/polyfill/performance.d.ts +0 -0
  204. package/dist/types/polyfill/requestAnimationFrame.d.ts +1 -0
  205. package/dist/types/polyfill/roundrect.d.ts +0 -0
  206. package/dist/types/renderable/collectable.d.ts +19 -0
  207. package/dist/types/renderable/colorlayer.d.ts +28 -0
  208. package/dist/types/renderable/container.d.ts +302 -0
  209. package/dist/types/renderable/dragndrop.d.ts +118 -0
  210. package/dist/types/renderable/imagelayer.d.ts +106 -0
  211. package/dist/types/renderable/light2d.d.ts +58 -0
  212. package/dist/types/renderable/nineslicesprite.d.ts +59 -0
  213. package/dist/types/renderable/renderable.d.ts +402 -0
  214. package/dist/types/renderable/sprite.d.ts +268 -0
  215. package/dist/types/renderable/trigger.d.ts +61 -0
  216. package/dist/types/renderable/ui/uibaseelement.d.ts +95 -0
  217. package/dist/types/renderable/ui/uispriteelement.d.ts +127 -0
  218. package/dist/types/renderable/ui/uitextbutton.d.ts +54 -0
  219. package/dist/types/state/stage.d.ts +116 -0
  220. package/dist/types/state/state.d.ts +170 -0
  221. package/dist/types/system/device.d.ts +579 -0
  222. package/dist/types/system/dom.d.ts +1 -0
  223. package/dist/types/system/event.d.ts +473 -0
  224. package/dist/types/system/platform.d.ts +31 -0
  225. package/dist/types/system/pooling.d.ts +101 -0
  226. package/dist/types/system/save.d.ts +25 -0
  227. package/dist/types/system/timer.d.ts +126 -0
  228. package/dist/types/text/bitmaptext.d.ts +151 -0
  229. package/dist/types/text/bitmaptextdata.d.ts +35 -0
  230. package/dist/types/text/glyph.d.ts +28 -0
  231. package/dist/types/text/text.d.ts +173 -0
  232. package/dist/types/text/textmetrics.d.ts +47 -0
  233. package/dist/types/text/textstyle.d.ts +5 -0
  234. package/dist/types/tweens/easing.d.ts +46 -0
  235. package/dist/types/tweens/interpolation.d.ts +18 -0
  236. package/dist/types/tweens/tween.d.ts +195 -0
  237. package/dist/types/utils/agent.d.ts +21 -0
  238. package/dist/types/utils/array.d.ts +39 -0
  239. package/dist/types/utils/file.d.ts +18 -0
  240. package/dist/types/utils/function.d.ts +32 -0
  241. package/dist/types/utils/string.d.ts +50 -0
  242. package/dist/types/utils/utils.d.ts +17 -0
  243. package/dist/types/video/canvas/canvas_renderer.d.ts +380 -0
  244. package/dist/types/video/renderer.d.ts +222 -0
  245. package/dist/types/video/texture/atlas.d.ts +201 -0
  246. package/dist/types/video/texture/cache.d.ts +45 -0
  247. package/dist/types/video/texture/canvas_texture.d.ts +78 -0
  248. package/dist/types/video/utils/autodetect.d.ts +7 -0
  249. package/dist/types/video/utils/resize.d.ts +4 -0
  250. package/dist/types/video/video.d.ts +93 -0
  251. package/dist/types/video/webgl/buffer/vertex.d.ts +56 -0
  252. package/dist/types/video/webgl/glshader.d.ts +93 -0
  253. package/dist/types/video/webgl/utils/attributes.d.ts +4 -0
  254. package/dist/types/video/webgl/utils/precision.d.ts +13 -0
  255. package/dist/types/video/webgl/utils/program.d.ts +5 -0
  256. package/dist/types/video/webgl/utils/string.d.ts +5 -0
  257. package/dist/types/video/webgl/utils/uniforms.d.ts +4 -0
  258. package/dist/types/video/webgl/webgl_compositor.d.ts +174 -0
  259. package/dist/types/video/webgl/webgl_renderer.d.ts +429 -0
  260. package/package.json +8 -8
  261. package/src/application/application.js +138 -7
  262. package/src/application/header.js +25 -0
  263. package/src/{video/utils → application}/resize.js +11 -6
  264. package/src/application/settings.js +19 -0
  265. package/src/camera/camera2d.js +1 -1
  266. package/src/const.js +23 -0
  267. package/src/index.js +36 -23
  268. package/src/input/pointer.js +1 -1
  269. package/src/input/pointerevent.js +1 -1
  270. package/src/lang/console.js +36 -0
  271. package/src/lang/deprecated.js +2 -37
  272. package/src/level/level.js +1 -1
  273. package/src/level/tiled/TMXGroup.js +0 -21
  274. package/src/level/tiled/TMXLayer.js +66 -56
  275. package/src/level/tiled/TMXObject.js +0 -62
  276. package/src/level/tiled/TMXTile.js +8 -24
  277. package/src/level/tiled/TMXTileMap.js +17 -83
  278. package/src/level/tiled/TMXTileset.js +0 -14
  279. package/src/level/tiled/TMXTilesetGroup.js +1 -9
  280. package/src/level/tiled/TMXUtils.js +38 -15
  281. package/src/level/tiled/constants.js +8 -0
  282. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +5 -6
  283. package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -4
  284. package/src/level/tiled/renderer/TMXRenderer.js +0 -12
  285. package/src/level/tiled/renderer/autodetect.js +29 -0
  286. package/src/loader/loader.js +3 -1
  287. package/src/loader/loadingscreen.js +1 -1
  288. package/src/physics/collision.js +2 -2
  289. package/src/physics/detector.js +172 -145
  290. package/src/physics/world.js +10 -30
  291. package/src/renderable/container.js +7 -91
  292. package/src/renderable/imagelayer.js +1 -1
  293. package/src/renderable/trigger.js +1 -1
  294. package/src/renderable/ui/uibaseelement.js +1 -1
  295. package/src/state/stage.js +1 -1
  296. package/src/state/state.js +1 -1
  297. package/src/system/device.js +0 -20
  298. package/src/tweens/tween.js +1 -1
  299. package/src/video/canvas/canvas_renderer.js +3 -0
  300. package/src/video/renderer.js +7 -0
  301. package/src/video/texture/canvas_texture.js +2 -1
  302. package/src/video/utils/autodetect.js +18 -0
  303. package/src/video/video.js +26 -155
  304. package/src/video/webgl/glshader.js +3 -4
  305. package/src/video/webgl/utils/precision.js +18 -0
  306. package/src/video/webgl/webgl_renderer.js +3 -0
  307. package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-end.js +0 -13
  308. package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-start.js +0 -13
  309. package/dist/melonjs.mjs/node_modules/core-js/internals/a-callable.js +0 -22
  310. package/dist/melonjs.mjs/node_modules/core-js/internals/an-object.js +0 -21
  311. package/dist/melonjs.mjs/node_modules/core-js/internals/array-includes.js +0 -45
  312. package/dist/melonjs.mjs/node_modules/core-js/internals/classof-raw.js +0 -19
  313. package/dist/melonjs.mjs/node_modules/core-js/internals/classof.js +0 -43
  314. package/dist/melonjs.mjs/node_modules/core-js/internals/copy-constructor-properties.js +0 -32
  315. package/dist/melonjs.mjs/node_modules/core-js/internals/create-non-enumerable-property.js +0 -24
  316. package/dist/melonjs.mjs/node_modules/core-js/internals/create-property-descriptor.js +0 -17
  317. package/dist/melonjs.mjs/node_modules/core-js/internals/define-built-in.js +0 -43
  318. package/dist/melonjs.mjs/node_modules/core-js/internals/define-global-property.js +0 -23
  319. package/dist/melonjs.mjs/node_modules/core-js/internals/descriptors.js +0 -18
  320. package/dist/melonjs.mjs/node_modules/core-js/internals/document-all.js +0 -18
  321. package/dist/melonjs.mjs/node_modules/core-js/internals/document-create-element.js +0 -22
  322. package/dist/melonjs.mjs/node_modules/core-js/internals/engine-user-agent.js +0 -14
  323. package/dist/melonjs.mjs/node_modules/core-js/internals/engine-v8-version.js +0 -39
  324. package/dist/melonjs.mjs/node_modules/core-js/internals/entry-unbind.js +0 -18
  325. package/dist/melonjs.mjs/node_modules/core-js/internals/enum-bug-keys.js +0 -19
  326. package/dist/melonjs.mjs/node_modules/core-js/internals/export.js +0 -72
  327. package/dist/melonjs.mjs/node_modules/core-js/internals/fails.js +0 -16
  328. package/dist/melonjs.mjs/node_modules/core-js/internals/function-bind-native.js +0 -19
  329. package/dist/melonjs.mjs/node_modules/core-js/internals/function-call.js +0 -18
  330. package/dist/melonjs.mjs/node_modules/core-js/internals/function-name.js +0 -29
  331. package/dist/melonjs.mjs/node_modules/core-js/internals/function-uncurry-this.js +0 -22
  332. package/dist/melonjs.mjs/node_modules/core-js/internals/get-built-in.js +0 -22
  333. package/dist/melonjs.mjs/node_modules/core-js/internals/get-method.js +0 -21
  334. package/dist/melonjs.mjs/node_modules/core-js/internals/global.js +0 -25
  335. package/dist/melonjs.mjs/node_modules/core-js/internals/has-own-property.js +0 -23
  336. package/dist/melonjs.mjs/node_modules/core-js/internals/hidden-keys.js +0 -10
  337. package/dist/melonjs.mjs/node_modules/core-js/internals/ie8-dom-define.js +0 -24
  338. package/dist/melonjs.mjs/node_modules/core-js/internals/indexed-object.js +0 -28
  339. package/dist/melonjs.mjs/node_modules/core-js/internals/inspect-source.js +0 -27
  340. package/dist/melonjs.mjs/node_modules/core-js/internals/internal-state.js +0 -88
  341. package/dist/melonjs.mjs/node_modules/core-js/internals/is-callable.js +0 -22
  342. package/dist/melonjs.mjs/node_modules/core-js/internals/is-forced.js +0 -34
  343. package/dist/melonjs.mjs/node_modules/core-js/internals/is-null-or-undefined.js +0 -14
  344. package/dist/melonjs.mjs/node_modules/core-js/internals/is-object.js +0 -22
  345. package/dist/melonjs.mjs/node_modules/core-js/internals/is-symbol.js +0 -27
  346. package/dist/melonjs.mjs/node_modules/core-js/internals/length-of-array-like.js +0 -18
  347. package/dist/melonjs.mjs/node_modules/core-js/internals/make-built-in.js +0 -68
  348. package/dist/melonjs.mjs/node_modules/core-js/internals/math-trunc.js +0 -19
  349. package/dist/melonjs.mjs/node_modules/core-js/internals/object-define-property.js +0 -58
  350. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-descriptor.js +0 -41
  351. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-names.js +0 -23
  352. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-symbols.js +0 -12
  353. package/dist/melonjs.mjs/node_modules/core-js/internals/object-is-prototype-of.js +0 -14
  354. package/dist/melonjs.mjs/node_modules/core-js/internals/object-keys-internal.js +0 -35
  355. package/dist/melonjs.mjs/node_modules/core-js/internals/object-property-is-enumerable.js +0 -23
  356. package/dist/melonjs.mjs/node_modules/core-js/internals/ordinary-to-primitive.js +0 -28
  357. package/dist/melonjs.mjs/node_modules/core-js/internals/own-keys.js +0 -31
  358. package/dist/melonjs.mjs/node_modules/core-js/internals/require-object-coercible.js +0 -21
  359. package/dist/melonjs.mjs/node_modules/core-js/internals/shared-key.js +0 -21
  360. package/dist/melonjs.mjs/node_modules/core-js/internals/shared-store.js +0 -19
  361. package/dist/melonjs.mjs/node_modules/core-js/internals/shared.js +0 -24
  362. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-end.js +0 -22
  363. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-forced.js +0 -28
  364. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-start.js +0 -22
  365. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim.js +0 -45
  366. package/dist/melonjs.mjs/node_modules/core-js/internals/symbol-constructor-detection.js +0 -26
  367. package/dist/melonjs.mjs/node_modules/core-js/internals/to-absolute-index.js +0 -23
  368. package/dist/melonjs.mjs/node_modules/core-js/internals/to-indexed-object.js +0 -19
  369. package/dist/melonjs.mjs/node_modules/core-js/internals/to-integer-or-infinity.js +0 -20
  370. package/dist/melonjs.mjs/node_modules/core-js/internals/to-length.js +0 -20
  371. package/dist/melonjs.mjs/node_modules/core-js/internals/to-object.js +0 -20
  372. package/dist/melonjs.mjs/node_modules/core-js/internals/to-primitive.js +0 -41
  373. package/dist/melonjs.mjs/node_modules/core-js/internals/to-property-key.js +0 -21
  374. package/dist/melonjs.mjs/node_modules/core-js/internals/to-string-tag-support.js +0 -19
  375. package/dist/melonjs.mjs/node_modules/core-js/internals/to-string.js +0 -19
  376. package/dist/melonjs.mjs/node_modules/core-js/internals/try-to-string.js +0 -18
  377. package/dist/melonjs.mjs/node_modules/core-js/internals/uid.js +0 -20
  378. package/dist/melonjs.mjs/node_modules/core-js/internals/use-symbol-as-uid.js +0 -18
  379. package/dist/melonjs.mjs/node_modules/core-js/internals/v8-prototype-define-bug.js +0 -24
  380. package/dist/melonjs.mjs/node_modules/core-js/internals/weak-map-basic-detection.js +0 -18
  381. package/dist/melonjs.mjs/node_modules/core-js/internals/well-known-symbol.js +0 -41
  382. package/dist/melonjs.mjs/node_modules/core-js/internals/whitespaces.js +0 -12
  383. package/dist/melonjs.mjs/node_modules/core-js/modules/es.global-this.js +0 -18
  384. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-end.js +0 -22
  385. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-left.js +0 -19
  386. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-right.js +0 -19
  387. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-start.js +0 -22
  388. package/dist/melonjs.mjs/node_modules/eventemitter3/index.mjs.js +0 -9
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
- import { rayCast } from './detector.js';
8
+ import { game } from '../index.js';
9
9
 
10
10
  /**
11
11
  * Collision detection (and projection-based collision response) of 2D shapes.<br>
@@ -124,7 +124,7 @@ var collision = {
124
124
  * // ...
125
125
  * }
126
126
  */
127
- rayCast(line, result) { return rayCast(line, result); }
127
+ rayCast(line, result) { return game.world.detector.rayCast(line, result); }
128
128
  };
129
129
 
130
130
  var collision$1 = collision;
@@ -1,14 +1,13 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import * as sat from './sat.js';
9
9
  import ResponseObject from './response.js';
10
10
  import Vector2d from '../math/vector2.js';
11
- import game from '../game.js';
12
11
  import Bounds from './bounds.js';
13
12
 
14
13
  // a dummy object when using Line for raycasting
@@ -22,169 +21,198 @@ let dummyObj = {
22
21
  }
23
22
  };
24
23
 
24
+ // some cache bounds object used for collision detection
25
25
  let boundsA = new Bounds();
26
26
  let boundsB = new Bounds();
27
27
 
28
- // the global response object used for collisions
29
- let globalResponse = new ResponseObject();
30
-
31
28
  /**
32
- * a function used to determine if two objects should collide (based on both respective objects collision mask and type).<br>
33
- * you can redefine this function if you need any specific rules over what should collide with what.
34
- * @ignore
35
- * @param {Renderable} a - a reference to the object A.
36
- * @param {Renderable} b - a reference to the object B.
37
- * @returns {boolean} true if they should collide, false otherwise
29
+ * the Detector class contains methods for detecting collisions between bodies using a broadphase algorithm.
38
30
  */
39
- function shouldCollide(a, b) {
40
- var bodyA = a.body,
41
- bodyB = b.body;
42
- return (
43
- a !== b &&
44
- a.isKinematic !== true && b.isKinematic !== true &&
45
- typeof bodyA === "object" && typeof bodyB === "object" &&
46
- bodyA.shapes.length > 0 && bodyB.shapes.length > 0 &&
47
- !(bodyA.isStatic === true && bodyB.isStatic === true) &&
48
- (bodyA.collisionMask & bodyB.collisionType) !== 0 &&
49
- (bodyA.collisionType & bodyB.collisionMask) !== 0
50
- );
51
- }
52
-
53
-
54
-
55
- /**
56
- * find all the collisions for the specified object
57
- * @ignore
58
- * @param {Renderable} objA - object to be tested for collision
59
- * @param {ResponseObject} [response] - a user defined response object that will be populated if they intersect.
60
- * @returns {boolean} in case of collision, false otherwise
61
- */
62
- function collisionCheck(objA, response = globalResponse) {
63
- var collisionCounter = 0;
64
- // retreive a list of potential colliding objects from the game world
65
- var candidates = game.world.broadphase.retrieve(objA);
31
+ class Detector {
32
+ /**
33
+ * @param {Container} world - the physic world this detector is bind to
34
+ */
35
+ constructor(world) {
36
+ // @ignore
37
+ this.world = world;
38
+
39
+ /**
40
+ * the default response object used for collisions
41
+ * (will be automatically populated by the collides functions)
42
+ * @type {ResponseObject}
43
+ */
44
+ this.response = new ResponseObject();
45
+ }
66
46
 
67
- boundsA.addBounds(objA.getBounds(), true);
68
- boundsA.addBounds(objA.body.getBounds());
47
+ /**
48
+ * determine if two objects should collide (based on both respective objects body collision mask and type).<br>
49
+ * you can redefine this function if you need any specific rules over what should collide with what.
50
+ * @param {Renderable} a - a reference to the object A.
51
+ * @param {Renderable} b - a reference to the object B.
52
+ * @returns {boolean} true if they should collide, false otherwise
53
+ */
54
+ shouldCollide(a, b) {
55
+ var bodyA = a.body,
56
+ bodyB = b.body;
57
+ return (
58
+ (typeof bodyA === "object" && typeof bodyB === "object") &&
59
+ a !== b &&
60
+ a.isKinematic !== true && b.isKinematic !== true &&
61
+ bodyA.shapes.length > 0 && bodyB.shapes.length > 0 &&
62
+ !(bodyA.isStatic === true && bodyB.isStatic === true) &&
63
+ (bodyA.collisionMask & bodyB.collisionType) !== 0 &&
64
+ (bodyA.collisionType & bodyB.collisionMask) !== 0
65
+ );
66
+ }
69
67
 
70
- candidates.forEach((objB) => {
71
- // check if both objects "should" collide
72
- if (shouldCollide(objA, objB)) {
68
+ /**
69
+ * detect collision between two bodies.
70
+ * @param {Body} bodyA - a reference to body A.
71
+ * @param {Body} bodyB - a reference to body B.
72
+ * @returns {Boolean} true if colliding
73
+ */
74
+ collides(bodyA, bodyB, response = this.response) {
75
+ // for each shape in body A
76
+ for (var indexA = bodyA.shapes.length, shapeA; indexA--, (shapeA = bodyA.shapes[indexA]);) {
77
+ // for each shape in body B
78
+ for (var indexB = bodyB.shapes.length, shapeB; indexB--, (shapeB = bodyB.shapes[indexB]);) {
79
+ // full SAT collision check
80
+ if (sat["test" + shapeA.shapeType + shapeB.shapeType].call(
81
+ this,
82
+ bodyA.ancestor, // a reference to the object A
83
+ shapeA,
84
+ bodyB.ancestor, // a reference to the object B
85
+ shapeB,
86
+ // clear response object before reusing
87
+ response.clear()) === true
88
+ ) {
73
89
 
74
- boundsB.addBounds(objB.getBounds(), true);
75
- boundsB.addBounds(objB.body.getBounds());
90
+ // set the shape index
91
+ response.indexShapeA = indexA;
92
+ response.indexShapeB = indexB;
76
93
 
77
- // fast AABB check if both bounding boxes are overlaping
78
- if (boundsA.overlaps(boundsB)) {
79
- // for each shape in body A
80
- objA.body.shapes.forEach((shapeA, indexA) => {
81
- // for each shape in body B
82
- objB.body.shapes.forEach((shapeB, indexB) => {
83
- // full SAT collision check
84
- if (sat["test" + shapeA.shapeType + shapeB.shapeType].call(
85
- this,
86
- objA, // a reference to the object A
87
- shapeA,
88
- objB, // a reference to the object B
89
- shapeB,
90
- // clear response object before reusing
91
- response.clear()) === true
92
- ) {
93
- // we touched something !
94
- collisionCounter++;
95
-
96
- // set the shape index
97
- response.indexShapeA = indexA;
98
- response.indexShapeB = indexB;
99
-
100
- // execute the onCollision callback
101
- if (objA.onCollision && objA.onCollision(response, objB) !== false && objA.body.isStatic === false) {
102
- objA.body.respondToCollision.call(objA.body, response);
103
- }
104
- if (objB.onCollision && objB.onCollision(response, objA) !== false && objB.body.isStatic === false) {
105
- objB.body.respondToCollision.call(objB.body, response);
106
- }
107
- }
108
- });
109
- });
94
+ return true;
95
+ }
110
96
  }
111
97
  }
112
- });
113
- // we could return the amount of objects we collided with ?
114
- return collisionCounter > 0;
115
- }
116
-
117
- /**
118
- * Checks for object colliding with the given line
119
- * @ignore
120
- * @param {Line} line - line to be tested for collision
121
- * @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
122
- * @returns {Array.<Renderable>} an array of intersecting physic objects
123
- * @example
124
- * // define a line accross the viewport
125
- * var ray = new me.Line(
126
- * // absolute position of the line
127
- * 0, 0, [
128
- * // starting point relative to the initial position
129
- * new me.Vector2d(0, 0),
130
- * // ending point
131
- * new me.Vector2d(me.game.viewport.width, me.game.viewport.height)
132
- * ]);
133
- *
134
- * // check for collition
135
- * result = me.collision.rayCast(ray);
136
- *
137
- * if (result.length > 0) {
138
- * // ...
139
- * }
140
- */
141
- function rayCast(line, result = []) {
142
- var collisionCounter = 0;
143
-
144
- // retrieve a list of potential colliding objects from the game world
145
- var candidates = game.world.broadphase.retrieve(line);
146
-
147
- for (var i = candidates.length, objB; i--, (objB = candidates[i]);) {
148
-
149
- // fast AABB check if both bounding boxes are overlaping
150
- if (objB.body && line.getBounds().overlaps(objB.getBounds())) {
98
+ return false;
99
+ }
151
100
 
152
- // go trough all defined shapes in B (if any)
153
- var bLen = objB.body.shapes.length;
154
- if ( objB.body.shapes.length === 0) {
155
- continue;
101
+ /**
102
+ * find all the collisions for the specified object using a broadphase algorithm
103
+ * @ignore
104
+ * @param {Renderable} objA - object to be tested for collision
105
+ * @returns {boolean} in case of collision, false otherwise
106
+ */
107
+ collisions(objA) {
108
+ var collisionCounter = 0;
109
+ // retreive a list of potential colliding objects from the game world
110
+ var candidates = this.world.broadphase.retrieve(objA);
111
+
112
+ boundsA.addBounds(objA.getBounds(), true);
113
+ boundsA.addBounds(objA.body.getBounds());
114
+
115
+ candidates.forEach((objB) => {
116
+ // check if both objects "should" collide
117
+ if (this.shouldCollide(objA, objB)) {
118
+
119
+ boundsB.addBounds(objB.getBounds(), true);
120
+ boundsB.addBounds(objB.body.getBounds());
121
+
122
+ // fast AABB check if both bounding boxes are overlaping
123
+ if (boundsA.overlaps(boundsB)) {
124
+
125
+ if (this.collides(objA.body, objB.body)) {
126
+ // we touched something !
127
+ collisionCounter++;
128
+
129
+ // execute the onCollision callback
130
+ if (objA.onCollision && objA.onCollision(this.response, objB) !== false && objA.body.isStatic === false) {
131
+ objA.body.respondToCollision.call(objA.body, this.response);
132
+ }
133
+ if (objB.onCollision && objB.onCollision(this.response, objA) !== false && objB.body.isStatic === false) {
134
+ objB.body.respondToCollision.call(objB.body, this.response);
135
+ }
136
+ }
137
+ }
156
138
  }
139
+ });
140
+ // we could return the amount of objects we collided with ?
141
+ return collisionCounter > 0;
142
+ }
157
143
 
158
- var shapeA = line;
144
+ /**
145
+ * Checks for object colliding with the given line
146
+ * @ignore
147
+ * @param {Line} line - line to be tested for collision
148
+ * @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
149
+ * @returns {Array.<Renderable>} an array of intersecting physic objects
150
+ * @example
151
+ * // define a line accross the viewport
152
+ * var ray = new me.Line(
153
+ * // absolute position of the line
154
+ * 0, 0, [
155
+ * // starting point relative to the initial position
156
+ * new me.Vector2d(0, 0),
157
+ * // ending point
158
+ * new me.Vector2d(me.game.viewport.width, me.game.viewport.height)
159
+ * ]);
160
+ *
161
+ * // check for collition
162
+ * result = me.collision.rayCast(ray);
163
+ *
164
+ * if (result.length > 0) {
165
+ * // ...
166
+ * }
167
+ */
168
+ rayCast(line, result = []) {
169
+ var collisionCounter = 0;
170
+
171
+ // retrieve a list of potential colliding objects from the game world
172
+ var candidates = this.world.broadphase.retrieve(line);
173
+
174
+ for (var i = candidates.length, objB; i--, (objB = candidates[i]);) {
159
175
 
160
- // go through all defined shapes in B
161
- var indexB = 0;
162
- do {
163
- var shapeB = objB.body.getShape(indexB);
176
+ // fast AABB check if both bounding boxes are overlaping
177
+ if (objB.body && line.getBounds().overlaps(objB.getBounds())) {
164
178
 
165
- // full SAT collision check
166
- if (sat["test" + shapeA.shapeType + shapeB.shapeType]
167
- .call(
168
- this,
169
- dummyObj, // a reference to the object A
170
- shapeA,
171
- objB, // a reference to the object B
172
- shapeB
173
- )) {
174
- // we touched something !
175
- result[collisionCounter] = objB;
176
- collisionCounter++;
179
+ // go trough all defined shapes in B (if any)
180
+ var bLen = objB.body.shapes.length;
181
+ if ( objB.body.shapes.length === 0) {
182
+ continue;
177
183
  }
178
- indexB++;
179
- } while (indexB < bLen);
184
+
185
+ var shapeA = line;
186
+
187
+ // go through all defined shapes in B
188
+ var indexB = 0;
189
+ do {
190
+ var shapeB = objB.body.getShape(indexB);
191
+
192
+ // full SAT collision check
193
+ if (sat["test" + shapeA.shapeType + shapeB.shapeType]
194
+ .call(
195
+ this,
196
+ dummyObj, // a reference to the object A
197
+ shapeA,
198
+ objB, // a reference to the object B
199
+ shapeB
200
+ )) {
201
+ // we touched something !
202
+ result[collisionCounter] = objB;
203
+ collisionCounter++;
204
+ }
205
+ indexB++;
206
+ } while (indexB < bLen);
207
+ }
180
208
  }
181
- }
182
209
 
183
- // cap result in case it was not empty
184
- result.length = collisionCounter;
210
+ // cap result in case it was not empty
211
+ result.length = collisionCounter;
185
212
 
186
- // return the list of colliding objects
187
- return result;
213
+ // return the list of colliding objects
214
+ return result;
215
+ }
188
216
  }
189
217
 
190
- export { collisionCheck, rayCast };
218
+ export { Detector as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import Vector2d from '../math/vector2.js';
9
9
  import { remove } from '../utils/array.js';
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import Vector2d from '../math/vector2.js';
9
9
 
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import Vector2d from '../math/vector2.js';
9
9
 
@@ -1,16 +1,16 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import Vector2d from '../math/vector2.js';
9
9
  import { on, GAME_RESET, LEVEL_LOADED } from '../system/event.js';
10
10
  import QuadTree from './quadtree.js';
11
11
  import Container from '../renderable/container.js';
12
12
  import collision from './collision.js';
13
- import { collisionCheck } from './detector.js';
13
+ import Detector from './detector.js';
14
14
  import state from '../state/state.js';
15
15
 
16
16
  /**
@@ -37,30 +37,22 @@ import state from '../state/state.js';
37
37
 
38
38
  /**
39
39
  * the application (game) this physic world belong to
40
- * @public
41
40
  * @type {Application}
42
41
  */
43
- this.app = null;
42
+ this.app = undefined;
44
43
 
45
44
  /**
46
45
  * the rate at which the game world is updated,
47
46
  * may be greater than or lower than the display fps
48
- * @public
49
- * @type {Vector2d}
50
47
  * @default 60
51
- * @name fps
52
- * @memberof World
53
48
  * @see timer.maxfps
54
49
  */
55
50
  this.fps = 60;
56
51
 
57
52
  /**
58
53
  * world gravity
59
- * @public
60
54
  * @type {Vector2d}
61
55
  * @default <0,0.98>
62
- * @name gravity
63
- * @memberof World
64
56
  */
65
57
  this.gravity = new Vector2d(0, 0.98);
66
58
 
@@ -74,28 +66,27 @@ import state from '../state/state.js';
74
66
  * property to your layer (in Tiled).
75
67
  * @type {boolean}
76
68
  * @default false
77
- * @memberof World
78
69
  */
79
70
  this.preRender = false;
80
71
 
81
72
  /**
82
73
  * the active physic bodies in this simulation
83
- * @name bodies
84
- * @memberof World
85
- * @public
86
74
  * @type {Set<Body>}
87
75
  */
88
76
  this.bodies = new Set();
89
77
 
90
78
  /**
91
79
  * the instance of the game world quadtree used for broadphase
92
- * @name broadphase
93
- * @memberof World
94
- * @public
95
80
  * @type {QuadTree}
96
81
  */
97
82
  this.broadphase = new QuadTree(this, this.getBounds().clone(), collision.maxChildren, collision.maxDepth);
98
83
 
84
+ /**
85
+ * the collision detector instance used by this world instance
86
+ * @type {Detector}
87
+ */
88
+ this.detector = new Detector(this);
89
+
99
90
  // reset the world container on the game reset signal
100
91
  on(GAME_RESET, this.reset, this);
101
92
 
@@ -108,8 +99,6 @@ import state from '../state/state.js';
108
99
 
109
100
  /**
110
101
  * reset the game world
111
- * @name reset
112
- * @memberof World
113
102
  */
114
103
  reset() {
115
104
  // clear the quadtree
@@ -128,8 +117,6 @@ import state from '../state/state.js';
128
117
 
129
118
  /**
130
119
  * Add a physic body to the game world
131
- * @name addBody
132
- * @memberof World
133
120
  * @see Container.addChild
134
121
  * @param {Body} body
135
122
  * @returns {World} this game world
@@ -142,8 +129,6 @@ import state from '../state/state.js';
142
129
 
143
130
  /**
144
131
  * Remove a physic body from the game world
145
- * @name removeBody
146
- * @memberof World
147
132
  * @see Container.removeChild
148
133
  * @param {Body} body
149
134
  * @returns {World} this game world
@@ -156,8 +141,6 @@ import state from '../state/state.js';
156
141
 
157
142
  /**
158
143
  * Apply gravity to the given body
159
- * @name bodyApplyVelocity
160
- * @memberof World
161
144
  * @private
162
145
  * @param {Body} body
163
146
  */
@@ -174,8 +157,6 @@ import state from '../state/state.js';
174
157
 
175
158
  /**
176
159
  * update the game world
177
- * @name reset
178
- * @memberof World
179
160
  * @param {number} dt - the time passed since the last frame update
180
161
  * @returns {boolean} true if the word is dirty
181
162
  */
@@ -203,7 +184,7 @@ import state from '../state/state.js';
203
184
  ancestor.isDirty = true;
204
185
  }
205
186
  // handle collisions against other objects
206
- collisionCheck(ancestor);
187
+ this.detector.collisions(ancestor);
207
188
  // clear body force
208
189
  body.force.set(0, 0);
209
190
  }
@@ -213,7 +194,6 @@ import state from '../state/state.js';
213
194
  // call the super constructor
214
195
  return super.update(dt);
215
196
  }
216
-
217
197
  }
218
198
 
219
199
  export { World as default };
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import utils from '../utils/utils.js';
9
9
  import { version } from '../index.js';
@@ -24,10 +24,10 @@ class BasePlugin {
24
24
  * this can be overridden by the plugin
25
25
  * @public
26
26
  * @type {string}
27
- * @default "14.2.0"
27
+ * @default "14.4.0"
28
28
  * @name plugin.Base#version
29
29
  */
30
- this.version = "14.2.0";
30
+ this.version = "14.4.0";
31
31
  }
32
32
  }
33
33
 
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import Sprite from './sprite.js';
9
9
  import Body from '../physics/body.js';
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * melonJS Game Engine - v14.2.0
2
+ * melonJS Game Engine - v14.4.0
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
6
- * @copyright (C) 2011 - 2022 Olivier Biot (AltByte Pte Ltd)
6
+ * @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
7
7
  */
8
8
  import pool from '../system/pooling.js';
9
9
  import Renderable from './renderable.js';