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
@@ -0,0 +1,250 @@
1
+ /**
2
+ * @classdesc
3
+ * a bound object contains methods for creating and manipulating axis-aligned bounding boxes (AABB).
4
+ */
5
+ export default class Bounds {
6
+ /**
7
+ * @param {Vector2d[]} [vertices] - an array of me.Vector2d points
8
+ */
9
+ constructor(vertices?: Vector2d[] | undefined);
10
+ _center: Vector2d;
11
+ /**
12
+ * @ignore
13
+ */
14
+ onResetEvent(vertices: any): void;
15
+ min: {
16
+ x: number;
17
+ y: number;
18
+ } | undefined;
19
+ max: {
20
+ x: number;
21
+ y: number;
22
+ } | undefined;
23
+ /**
24
+ * reset the bound
25
+ * @name clear
26
+ * @memberof Bounds
27
+ */
28
+ clear(): void;
29
+ /**
30
+ * sets the bounds to the given min and max value
31
+ * @name setMinMax
32
+ * @memberof Bounds
33
+ * @param {number} minX
34
+ * @param {number} minY
35
+ * @param {number} maxX
36
+ * @param {number} maxY
37
+ */
38
+ setMinMax(minX: number, minY: number, maxX: number, maxY: number): void;
39
+ public set x(arg: number);
40
+ /**
41
+ * x position of the bound
42
+ * @public
43
+ * @type {number}
44
+ * @name x
45
+ * @memberof Bounds
46
+ */
47
+ public get x(): number;
48
+ public set y(arg: number);
49
+ /**
50
+ * y position of the bounds
51
+ * @public
52
+ * @type {number}
53
+ * @name y
54
+ * @memberof Bounds
55
+ */
56
+ public get y(): number;
57
+ public set width(arg: number);
58
+ /**
59
+ * width of the bounds
60
+ * @public
61
+ * @type {number}
62
+ * @name width
63
+ * @memberof Bounds
64
+ */
65
+ public get width(): number;
66
+ public set height(arg: number);
67
+ /**
68
+ * width of the bounds
69
+ * @public
70
+ * @type {number}
71
+ * @name width
72
+ * @memberof Bounds
73
+ */
74
+ public get height(): number;
75
+ /**
76
+ * left coordinate of the bound
77
+ * @public
78
+ * @type {number}
79
+ * @name left
80
+ * @memberof Bounds
81
+ */
82
+ public get left(): number;
83
+ /**
84
+ * right coordinate of the bound
85
+ * @public
86
+ * @type {number}
87
+ * @name right
88
+ * @memberof Bounds
89
+ */
90
+ public get right(): number;
91
+ /**
92
+ * top coordinate of the bound
93
+ * @public
94
+ * @type {number}
95
+ * @name top
96
+ * @memberof Bounds
97
+ */
98
+ public get top(): number;
99
+ /**
100
+ * bottom coordinate of the bound
101
+ * @public
102
+ * @type {number}
103
+ * @name bottom
104
+ * @memberof Bounds
105
+ */
106
+ public get bottom(): number;
107
+ /**
108
+ * center position of the bound on the x axis
109
+ * @public
110
+ * @type {number}
111
+ * @name centerX
112
+ * @memberof Bounds
113
+ */
114
+ public get centerX(): number;
115
+ /**
116
+ * center position of the bound on the y axis
117
+ * @public
118
+ * @type {number}
119
+ * @name centerY
120
+ * @memberof Bounds
121
+ */
122
+ public get centerY(): number;
123
+ /**
124
+ * return the center position of the bound
125
+ * @public
126
+ * @type {Vector2d}
127
+ * @name center
128
+ * @memberof Bounds
129
+ */
130
+ public get center(): Vector2d;
131
+ /**
132
+ * Updates bounds using the given vertices
133
+ * @name update
134
+ * @memberof Bounds
135
+ * @param {Vector2d[]} vertices - an array of me.Vector2d points
136
+ */
137
+ update(vertices: Vector2d[]): void;
138
+ /**
139
+ * add the given vertices to the bounds definition.
140
+ * @name add
141
+ * @memberof Bounds
142
+ * @param {Vector2d[]} vertices - an array of me.Vector2d points
143
+ * @param {boolean} [clear=false] - either to reset the bounds before adding the new vertices
144
+ */
145
+ add(vertices: Vector2d[], clear?: boolean | undefined): void;
146
+ /**
147
+ * add the given bounds to the bounds definition.
148
+ * @name addBounds
149
+ * @memberof Bounds
150
+ * @param {Bounds} bounds
151
+ * @param {boolean} [clear=false] - either to reset the bounds before adding the new vertices
152
+ */
153
+ addBounds(bounds: Bounds, clear?: boolean | undefined): void;
154
+ /**
155
+ * add the given point to the bounds definition.
156
+ * @name addPoint
157
+ * @memberof Bounds
158
+ * @param {Vector2d|Point} point - the point to be added to the bounds
159
+ * @param {Matrix2d} [m] - an optional transform to apply to the given point (only if the given point is a vector)
160
+ */
161
+ addPoint(point: Vector2d | Point, m?: any): void;
162
+ /**
163
+ * add the given quad coordinates to this bound definition, multiplied by the given matrix
164
+ * @name addFrame
165
+ * @memberof Bounds
166
+ * @param {number} x0 - left X coordinates of the quad
167
+ * @param {number} y0 - top Y coordinates of the quad
168
+ * @param {number} x1 - right X coordinates of the quad
169
+ * @param {number} y1 - bottom y coordinates of the quad
170
+ * @param {Matrix2d} [m] - an optional transform to apply to the given frame coordinates
171
+ */
172
+ addFrame(x0: number, y0: number, x1: number, y1: number, m?: any): void;
173
+ /**
174
+ * Returns true if the bounds contains the given point.
175
+ * @name contains
176
+ * @memberof Bounds
177
+ * @method
178
+ * @param {Vector2d} point
179
+ * @returns {boolean} True if the bounds contain the point, otherwise false
180
+ */
181
+ /**
182
+ * Returns true if the bounds contains the given point.
183
+ * @name contains
184
+ * @memberof Bounds
185
+ * @param {number} x
186
+ * @param {number} y
187
+ * @returns {boolean} True if the bounds contain the point, otherwise false
188
+ */
189
+ contains(...args: any[]): boolean;
190
+ /**
191
+ * Returns true if the two bounds intersect.
192
+ * @name overlaps
193
+ * @memberof Bounds
194
+ * @param {Bounds|Rect} bounds
195
+ * @returns {boolean} True if the bounds overlap, otherwise false
196
+ */
197
+ overlaps(bounds: Bounds | Rect): boolean;
198
+ /**
199
+ * determines whether all coordinates of this bounds are finite numbers.
200
+ * @name isFinite
201
+ * @memberof Bounds
202
+ * @returns {boolean} false if all coordinates are positive or negative Infinity or NaN; otherwise, true.
203
+ */
204
+ isFinite(): boolean;
205
+ /**
206
+ * Translates the bounds by the given vector.
207
+ * @name translate
208
+ * @memberof Bounds
209
+ * @method
210
+ * @param {Vector2d} vector
211
+ */
212
+ /**
213
+ * Translates the bounds by x on the x axis, and y on the y axis
214
+ * @name translate
215
+ * @memberof Bounds
216
+ * @param {number} x
217
+ * @param {number} y
218
+ */
219
+ translate(...args: any[]): void;
220
+ /**
221
+ * Shifts the bounds to the given position vector.
222
+ * @name shift
223
+ * @memberof Bounds
224
+ * @method
225
+ * @param {Vector2d} position
226
+ */
227
+ /**
228
+ * Shifts the bounds to the given x, y position.
229
+ * @name shift
230
+ * @memberof Bounds
231
+ * @param {number} x
232
+ * @param {number} y
233
+ */
234
+ shift(...args: any[]): void;
235
+ /**
236
+ * clone this bounds
237
+ * @name clone
238
+ * @memberof Bounds
239
+ * @returns {Bounds}
240
+ */
241
+ clone(): Bounds;
242
+ /**
243
+ * Returns a polygon whose edges are the same as this bounds.
244
+ * @name toPolygon
245
+ * @memberof Bounds
246
+ * @returns {Polygon} a new Polygon that represents this bounds.
247
+ */
248
+ toPolygon(): Polygon;
249
+ }
250
+ import Vector2d from "./../math/vector2.js";
@@ -0,0 +1,44 @@
1
+ export default collision;
2
+ declare namespace collision {
3
+ const maxChildren: number;
4
+ const maxDepth: number;
5
+ namespace types {
6
+ const NO_OBJECT: number;
7
+ const PLAYER_OBJECT: number;
8
+ const NPC_OBJECT: number;
9
+ const ENEMY_OBJECT: number;
10
+ const COLLECTABLE_OBJECT: number;
11
+ const ACTION_OBJECT: number;
12
+ const PROJECTILE_OBJECT: number;
13
+ const WORLD_SHAPE: number;
14
+ const USER: number;
15
+ const ALL_OBJECT: number;
16
+ }
17
+ /**
18
+ * Checks for object colliding with the given line
19
+ * @name rayCast
20
+ * @memberof collision
21
+ * @public
22
+ * @param {Line} line - line to be tested for collision
23
+ * @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
24
+ * @returns {Array.<Renderable>} an array of intersecting physic objects
25
+ * @example
26
+ * // define a line accross the viewport
27
+ * var ray = new me.Line(
28
+ * // absolute position of the line
29
+ * 0, 0, [
30
+ * // starting point relative to the initial position
31
+ * new me.Vector2d(0, 0),
32
+ * // ending point
33
+ * new me.Vector2d(me.game.viewport.width, me.game.viewport.height)
34
+ * ]);
35
+ *
36
+ * // check for collition
37
+ * result = me.collision.rayCast(ray);
38
+ *
39
+ * if (result.length > 0) {
40
+ * // ...
41
+ * }
42
+ */
43
+ function rayCast(line: Line, result?: Renderable[] | undefined): Renderable[];
44
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * the Detector class contains methods for detecting collisions between bodies using a broadphase algorithm.
3
+ */
4
+ export default class Detector {
5
+ /**
6
+ * @param {Container} world - the physic world this detector is bind to
7
+ */
8
+ constructor(world: Container);
9
+ world: Container;
10
+ /**
11
+ * the default response object used for collisions
12
+ * (will be automatically populated by the collides functions)
13
+ * @type {ResponseObject}
14
+ */
15
+ response: ResponseObject;
16
+ /**
17
+ * determine if two objects should collide (based on both respective objects body collision mask and type).<br>
18
+ * you can redefine this function if you need any specific rules over what should collide with what.
19
+ * @param {Renderable} a - a reference to the object A.
20
+ * @param {Renderable} b - a reference to the object B.
21
+ * @returns {boolean} true if they should collide, false otherwise
22
+ */
23
+ shouldCollide(a: Renderable, b: Renderable): boolean;
24
+ /**
25
+ * detect collision between two bodies.
26
+ * @param {Body} bodyA - a reference to body A.
27
+ * @param {Body} bodyB - a reference to body B.
28
+ * @returns {Boolean} true if colliding
29
+ */
30
+ collides(bodyA: Body, bodyB: Body, response?: ResponseObject): boolean;
31
+ /**
32
+ * find all the collisions for the specified object using a broadphase algorithm
33
+ * @ignore
34
+ * @param {Renderable} objA - object to be tested for collision
35
+ * @returns {boolean} in case of collision, false otherwise
36
+ */
37
+ collisions(objA: Renderable): boolean;
38
+ /**
39
+ * Checks for object colliding with the given line
40
+ * @ignore
41
+ * @param {Line} line - line to be tested for collision
42
+ * @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
43
+ * @returns {Array.<Renderable>} an array of intersecting physic objects
44
+ * @example
45
+ * // define a line accross the viewport
46
+ * var ray = new me.Line(
47
+ * // absolute position of the line
48
+ * 0, 0, [
49
+ * // starting point relative to the initial position
50
+ * new me.Vector2d(0, 0),
51
+ * // ending point
52
+ * new me.Vector2d(me.game.viewport.width, me.game.viewport.height)
53
+ * ]);
54
+ *
55
+ * // check for collition
56
+ * result = me.collision.rayCast(ray);
57
+ *
58
+ * if (result.length > 0) {
59
+ * // ...
60
+ * }
61
+ */
62
+ rayCast(line: Line, result?: Renderable[] | undefined): Array<Renderable>;
63
+ }
64
+ import ResponseObject from "./response.js";
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @classdesc
3
+ * a QuadTree implementation in JavaScript, a 2d spatial subdivision algorithm.
4
+ * @see game.world.broadphase
5
+ */
6
+ export default class QuadTree {
7
+ /**
8
+ * @param {World} world - the physic world this QuadTree belongs to
9
+ * @param {Bounds} bounds - bounds of the node
10
+ * @param {number} [max_objects=4] - max objects a node can hold before splitting into 4 subnodes
11
+ * @param {number} [max_levels=4] - total max levels inside root Quadtree
12
+ * @param {number} [level] - deepth level, required for subnodes
13
+ */
14
+ constructor(world: World, bounds: Bounds, max_objects?: number | undefined, max_levels?: number | undefined, level?: number | undefined);
15
+ world: World;
16
+ bounds: Bounds;
17
+ max_objects: number;
18
+ max_levels: number;
19
+ level: number;
20
+ objects: any[];
21
+ nodes: any[];
22
+ split(): void;
23
+ getIndex(item: any): number;
24
+ /**
25
+ * Insert the given object container into the node.
26
+ * @name insertContainer
27
+ * @memberof QuadTree
28
+ * @param {Container} container - group of objects to be added
29
+ */
30
+ insertContainer(container: Container): void;
31
+ /**
32
+ * Insert the given object into the node. If the node
33
+ * exceeds the capacity, it will split and add all
34
+ * objects to their corresponding subnodes.
35
+ * @name insert
36
+ * @memberof QuadTree
37
+ * @param {object} item - object to be added
38
+ */
39
+ insert(item: object): void;
40
+ /**
41
+ * Return all objects that could collide with the given object
42
+ * @name retrieve
43
+ * @memberof QuadTree
44
+ * @param {object} item - object to be checked against
45
+ * @param {object} [fn] - a sorting function for the returned array
46
+ * @returns {object[]} array with all detected objects
47
+ */
48
+ retrieve(item: object, fn?: object | undefined): object[];
49
+ /**
50
+ * Remove the given item from the quadtree.
51
+ * (this function won't recalculate the impacted node)
52
+ * @name remove
53
+ * @memberof QuadTree
54
+ * @param {object} item - object to be removed
55
+ * @returns {boolean} true if the item was found and removed.
56
+ */
57
+ remove(item: object): boolean;
58
+ /**
59
+ * return true if the node is prunable
60
+ * @name isPrunable
61
+ * @memberof QuadTree
62
+ * @returns {boolean} true if the node is prunable
63
+ */
64
+ isPrunable(): boolean;
65
+ /**
66
+ * return true if the node has any children
67
+ * @name hasChildren
68
+ * @memberof QuadTree
69
+ * @returns {boolean} true if the node has any children
70
+ */
71
+ hasChildren(): boolean;
72
+ /**
73
+ * clear the quadtree
74
+ * @name clear
75
+ * @memberof QuadTree
76
+ * @param {Bounds} [bounds=this.bounds] - the bounds to be cleared
77
+ */
78
+ clear(bounds?: any): void;
79
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @classdesc
3
+ * An object representing the result of an intersection.
4
+ * @property {Renderable} a The first object participating in the intersection
5
+ * @property {Renderable} b The second object participating in the intersection
6
+ * @property {number} overlap Magnitude of the overlap on the shortest colliding axis
7
+ * @property {Vector2d} overlapV The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
8
+ * @property {Vector2d} overlapN The shortest colliding axis (unit-vector)
9
+ * @property {boolean} aInB Whether the first object is entirely inside the second
10
+ * @property {boolean} bInA Whether the second object is entirely inside the first
11
+ * @property {number} indexShapeA The index of the colliding shape for the object a body
12
+ * @property {number} indexShapeB The index of the colliding shape for the object b body
13
+ * @name ResponseObject
14
+ * @public
15
+ */
16
+ export default class ResponseObject {
17
+ a: any;
18
+ b: any;
19
+ overlapN: Vector2d;
20
+ overlapV: Vector2d;
21
+ aInB: boolean;
22
+ bInA: boolean;
23
+ indexShapeA: number;
24
+ indexShapeB: number;
25
+ overlap: number;
26
+ /**
27
+ * Set some values of the response back to their defaults. <br>
28
+ * Call this between tests if you are going to reuse a single <br>
29
+ * Response object for multiple intersection tests <br>
30
+ * (recommended as it will avoid allocating extra memory) <br>
31
+ * @name clear
32
+ * @public
33
+ * @returns {object} this object for chaining
34
+ */
35
+ public clear(): object;
36
+ }
37
+ import Vector2d from "./../math/vector2.js";
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Checks whether polygons collide.
3
+ * @ignore
4
+ * @param {Renderable} a - a reference to the object A.
5
+ * @param {Polygon} polyA - a reference to the object A Polygon to be tested
6
+ * @param {Renderable} b - a reference to the object B.
7
+ * @param {Polygon} polyB - a reference to the object B Polygon to be tested
8
+ * @param {Response=} response - Response object (optional) that will be populated if they intersect.
9
+ * @returns {boolean} true if they intersect, false if they don't.
10
+ */
11
+ export function testPolygonPolygon(a: Renderable, polyA: Polygon, b: Renderable, polyB: Polygon, response?: Response | undefined): boolean;
12
+ /**
13
+ * Check if two Ellipse collide.
14
+ * @ignore
15
+ * @param {Renderable} a - a reference to the object A.
16
+ * @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
17
+ * @param {Renderable} b - a reference to the object B.
18
+ * @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
19
+ * @param {Response=} response - Response object (optional) that will be populated if
20
+ * the circles intersect.
21
+ * @returns {boolean} true if the circles intersect, false if they don't.
22
+ */
23
+ export function testEllipseEllipse(a: Renderable, ellipseA: Ellipse, b: Renderable, ellipseB: Ellipse, response?: Response | undefined): boolean;
24
+ /**
25
+ * Check if a polygon and an ellipse collide.
26
+ * @ignore
27
+ * @param {Renderable} a - a reference to the object A.
28
+ * @param {Polygon} polyA - a reference to the object A Polygon to be tested
29
+ * @param {Renderable} b - a reference to the object B.
30
+ * @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
31
+ * @param {Response=} response - Response object (optional) that will be populated if they intersect.
32
+ * @returns {boolean} true if they intersect, false if they don't.
33
+ */
34
+ export function testPolygonEllipse(a: Renderable, polyA: Polygon, b: Renderable, ellipseB: Ellipse, response?: Response | undefined): boolean;
35
+ /**
36
+ * Check if an ellipse and a polygon collide. <br>
37
+ * **NOTE:** This is slightly less efficient than testPolygonEllipse as it just
38
+ * runs testPolygonEllipse and reverses the response at the end.
39
+ * @ignore
40
+ * @param {Renderable} a - a reference to the object A.
41
+ * @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
42
+ * @param {Renderable} b - a reference to the object B.
43
+ * @param {Polygon} polyB - a reference to the object B Polygon to be tested
44
+ * @param {Response=} response - Response object (optional) that will be populated if
45
+ * they intersect.
46
+ * @returns {boolean} true if they intersect, false if they don't.
47
+ */
48
+ export function testEllipsePolygon(a: Renderable, ellipseA: Ellipse, b: Renderable, polyB: Polygon, response?: Response | undefined): boolean;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @classdesc
3
+ * an object representing the physic world, and responsible for managing and updating all childs and physics
4
+ * @augments Container
5
+ */
6
+ export default class World extends Container {
7
+ /**
8
+ * @param {number} [x=0] - position of the container (accessible via the inherited pos.x property)
9
+ * @param {number} [y=0] - position of the container (accessible via the inherited pos.y property)
10
+ * @param {number} [width=game.viewport.width] - width of the container
11
+ * @param {number} [height=game.viewport.height] - height of the container
12
+ */
13
+ constructor(x?: number | undefined, y?: number | undefined, width?: number | undefined, height?: number | undefined);
14
+ /**
15
+ * the application (game) this physic world belong to
16
+ * @type {Application}
17
+ */
18
+ app: Application;
19
+ /**
20
+ * the rate at which the game world is updated,
21
+ * may be greater than or lower than the display fps
22
+ * @default 60
23
+ * @see timer.maxfps
24
+ */
25
+ fps: number;
26
+ /**
27
+ * world gravity
28
+ * @type {Vector2d}
29
+ * @default <0,0.98>
30
+ */
31
+ gravity: Vector2d;
32
+ /**
33
+ * Specify the rendering method for tile layers. <br>
34
+ * if false visible part of the layers are rendered dynamically,<br>
35
+ * if true the entire layers are first rendered into an offscreen canvas.<br>
36
+ * the "best" rendering method depends of your game
37
+ * (amount of layer, layer size, amount of tiles per layer, etc.)<br>
38
+ * note : rendering method is also configurable per layer by adding this
39
+ * property to your layer (in Tiled).
40
+ * @type {boolean}
41
+ * @default false
42
+ */
43
+ preRender: boolean;
44
+ /**
45
+ * the active physic bodies in this simulation
46
+ * @type {Set<Body>}
47
+ */
48
+ bodies: Set<Body>;
49
+ /**
50
+ * the instance of the game world quadtree used for broadphase
51
+ * @type {QuadTree}
52
+ */
53
+ broadphase: QuadTree;
54
+ /**
55
+ * the collision detector instance used by this world instance
56
+ * @type {Detector}
57
+ */
58
+ detector: Detector;
59
+ /**
60
+ * Add a physic body to the game world
61
+ * @see Container.addChild
62
+ * @param {Body} body
63
+ * @returns {World} this game world
64
+ */
65
+ addBody(body: Body): World;
66
+ /**
67
+ * Remove a physic body from the game world
68
+ * @see Container.removeChild
69
+ * @param {Body} body
70
+ * @returns {World} this game world
71
+ */
72
+ removeBody(body: Body): World;
73
+ /**
74
+ * Apply gravity to the given body
75
+ * @private
76
+ * @param {Body} body
77
+ */
78
+ private bodyApplyGravity;
79
+ }
80
+ import Container from "../renderable/container.js";
81
+ import Vector2d from "./../math/vector2.js";
82
+ import QuadTree from "./quadtree.js";
83
+ import Detector from "./detector.js";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This namespace is a container for all registered plugins.
3
+ * @see plugin.register
4
+ * @namespace plugins
5
+ */
6
+ export const plugins: {};
7
+ /**
8
+ * @namespace plugin
9
+ */
10
+ export const plugin: any;
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1 @@
1
+ export {};
File without changes
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @classdesc
3
+ * a basic collectable helper class for immovable object (e.g. a coin)
4
+ * @augments Sprite
5
+ */
6
+ export default class Collectable extends Sprite {
7
+ /**
8
+ * @param {number} x - the x coordinates of the collectable
9
+ * @param {number} y - the y coordinates of the collectable
10
+ * @param {object} settings - See {@link Sprite}
11
+ */
12
+ constructor(x: number, y: number, settings: object);
13
+ name: any;
14
+ type: any;
15
+ id: any;
16
+ body: Body;
17
+ }
18
+ import Sprite from "./sprite.js";
19
+ import Body from "./../physics/body.js";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @classdesc
3
+ * a generic Color Layer Object. Fills the entire Canvas with the color not just the container the object belongs to.
4
+ * @augments Renderable
5
+ */
6
+ export default class ColorLayer extends Renderable {
7
+ /**
8
+ * @param {string} name - Layer name
9
+ * @param {Color|string} color - CSS color
10
+ * @param {number} [z = 0] - z-index position
11
+ */
12
+ constructor(name: string, color: Color | string, z?: number | undefined);
13
+ /**
14
+ * the layer color component
15
+ * @public
16
+ * @type {Color}
17
+ * @name color
18
+ * @memberof ColorLayer#
19
+ */
20
+ public color: Color;
21
+ onResetEvent(name: any, color: any, z?: number): void;
22
+ /**
23
+ * Destroy function
24
+ * @ignore
25
+ */
26
+ destroy(): void;
27
+ }
28
+ import Renderable from "./renderable.js";