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.
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +2 -2
- package/dist/melonjs.mjs/_virtual/arraymultimap.js +2 -2
- package/dist/melonjs.mjs/_virtual/earcut.js +2 -2
- package/dist/melonjs.mjs/_virtual/howler.js +2 -2
- package/dist/melonjs.mjs/_virtual/index.js +2 -2
- package/dist/melonjs.mjs/_virtual/index2.js +2 -2
- package/dist/melonjs.mjs/_virtual/multimap.js +2 -2
- package/dist/melonjs.mjs/_virtual/setmultimap.js +2 -2
- package/dist/melonjs.mjs/application/application.js +141 -10
- package/dist/melonjs.mjs/application/header.js +34 -0
- package/dist/melonjs.mjs/application/resize.js +4 -2
- package/dist/melonjs.mjs/application/settings.js +28 -0
- package/dist/melonjs.mjs/audio/audio.js +2 -2
- package/dist/melonjs.mjs/camera/camera2d.js +3 -3
- package/dist/melonjs.mjs/const.js +32 -0
- package/dist/melonjs.mjs/entity/entity.js +2 -2
- package/dist/melonjs.mjs/game.js +1 -1
- package/dist/melonjs.mjs/geometries/ellipse.js +2 -2
- package/dist/melonjs.mjs/geometries/line.js +2 -2
- package/dist/melonjs.mjs/geometries/path2d.js +2 -2
- package/dist/melonjs.mjs/geometries/point.js +2 -2
- package/dist/melonjs.mjs/geometries/poly.js +2 -2
- package/dist/melonjs.mjs/geometries/rectangle.js +2 -2
- package/dist/melonjs.mjs/geometries/roundrect.js +2 -2
- package/dist/melonjs.mjs/index.js +44 -33
- package/dist/melonjs.mjs/input/gamepad.js +2 -2
- package/dist/melonjs.mjs/input/input.js +2 -2
- package/dist/melonjs.mjs/input/keyboard.js +2 -2
- package/dist/melonjs.mjs/input/pointer.js +3 -3
- package/dist/melonjs.mjs/input/pointerevent.js +3 -3
- package/dist/melonjs.mjs/lang/console.js +44 -0
- package/dist/melonjs.mjs/lang/deprecated.js +4 -40
- package/dist/melonjs.mjs/level/level.js +3 -3
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +2 -23
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +68 -58
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +2 -64
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +10 -26
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +18 -84
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +2 -16
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +3 -10
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +37 -14
- package/dist/melonjs.mjs/level/tiled/constants.js +17 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +7 -8
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +3 -6
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +2 -14
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +2 -2
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +38 -0
- package/dist/melonjs.mjs/loader/loader.js +5 -3
- package/dist/melonjs.mjs/loader/loadingscreen.js +3 -3
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +2 -2
- package/dist/melonjs.mjs/math/color.js +2 -2
- package/dist/melonjs.mjs/math/math.js +2 -2
- package/dist/melonjs.mjs/math/matrix2.js +2 -2
- package/dist/melonjs.mjs/math/matrix3.js +2 -2
- package/dist/melonjs.mjs/math/observable_vector2.js +2 -2
- package/dist/melonjs.mjs/math/observable_vector3.js +2 -2
- package/dist/melonjs.mjs/math/vector2.js +2 -2
- package/dist/melonjs.mjs/math/vector3.js +2 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +2 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +2 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +2 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +2 -2
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +2 -2
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +2 -2
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +2 -2
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +2 -2
- package/dist/melonjs.mjs/particles/emitter.js +2 -2
- package/dist/melonjs.mjs/particles/particle.js +2 -2
- package/dist/melonjs.mjs/particles/settings.js +2 -2
- package/dist/melonjs.mjs/physics/body.js +2 -2
- package/dist/melonjs.mjs/physics/bounds.js +2 -2
- package/dist/melonjs.mjs/physics/collision.js +4 -4
- package/dist/melonjs.mjs/physics/detector.js +175 -147
- package/dist/melonjs.mjs/physics/quadtree.js +2 -2
- package/dist/melonjs.mjs/physics/response.js +2 -2
- package/dist/melonjs.mjs/physics/sat.js +2 -2
- package/dist/melonjs.mjs/physics/world.js +11 -31
- package/dist/melonjs.mjs/plugin/plugin.js +4 -4
- package/dist/melonjs.mjs/renderable/collectable.js +2 -2
- package/dist/melonjs.mjs/renderable/colorlayer.js +2 -2
- package/dist/melonjs.mjs/renderable/container.js +4 -88
- package/dist/melonjs.mjs/renderable/dragndrop.js +2 -2
- package/dist/melonjs.mjs/renderable/imagelayer.js +3 -3
- package/dist/melonjs.mjs/renderable/light2d.js +2 -2
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +2 -2
- package/dist/melonjs.mjs/renderable/renderable.js +2 -2
- package/dist/melonjs.mjs/renderable/sprite.js +2 -2
- package/dist/melonjs.mjs/renderable/trigger.js +3 -3
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +2 -2
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +2 -2
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +2 -2
- package/dist/melonjs.mjs/state/stage.js +3 -3
- package/dist/melonjs.mjs/state/state.js +3 -3
- package/dist/melonjs.mjs/system/device.js +3 -23
- package/dist/melonjs.mjs/system/dom.js +2 -2
- package/dist/melonjs.mjs/system/event.js +2 -2
- package/dist/melonjs.mjs/system/platform.js +2 -2
- package/dist/melonjs.mjs/system/pooling.js +2 -2
- package/dist/melonjs.mjs/system/save.js +2 -2
- package/dist/melonjs.mjs/system/timer.js +2 -2
- package/dist/melonjs.mjs/text/bitmaptext.js +2 -2
- package/dist/melonjs.mjs/text/bitmaptextdata.js +2 -2
- package/dist/melonjs.mjs/text/glyph.js +2 -2
- package/dist/melonjs.mjs/text/text.js +2 -2
- package/dist/melonjs.mjs/text/textmetrics.js +2 -2
- package/dist/melonjs.mjs/text/textstyle.js +2 -2
- package/dist/melonjs.mjs/tweens/easing.js +2 -2
- package/dist/melonjs.mjs/tweens/interpolation.js +2 -2
- package/dist/melonjs.mjs/tweens/tween.js +3 -3
- package/dist/melonjs.mjs/utils/agent.js +2 -2
- package/dist/melonjs.mjs/utils/array.js +2 -2
- package/dist/melonjs.mjs/utils/file.js +2 -2
- package/dist/melonjs.mjs/utils/function.js +2 -2
- package/dist/melonjs.mjs/utils/string.js +2 -2
- package/dist/melonjs.mjs/utils/utils.js +2 -2
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +5 -2
- package/dist/melonjs.mjs/video/renderer.js +9 -2
- package/dist/melonjs.mjs/video/texture/atlas.js +2 -2
- package/dist/melonjs.mjs/video/texture/cache.js +2 -2
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +4 -3
- package/dist/melonjs.mjs/video/utils/autodetect.js +27 -0
- package/dist/melonjs.mjs/video/utils/resize.js +1 -1
- package/dist/melonjs.mjs/video/video.js +29 -158
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +2 -2
- package/dist/melonjs.mjs/video/webgl/glshader.js +3 -4
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +2 -2
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +2 -2
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +2 -2
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +21 -3
- package/dist/melonjs.mjs/video/webgl/utils/program.js +2 -2
- package/dist/melonjs.mjs/video/webgl/utils/string.js +2 -2
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +2 -2
- package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +2 -2
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +5 -2
- package/dist/melonjs.module.js +20845 -20968
- package/dist/types/application/application.d.ts +148 -0
- package/dist/types/application/header.d.ts +5 -0
- package/dist/types/application/resize.d.ts +6 -0
- package/dist/types/application/settings.d.ts +18 -0
- package/dist/types/audio/audio.d.ts +267 -0
- package/dist/types/camera/camera2d.d.ts +289 -0
- package/dist/types/const.d.ts +21 -0
- package/dist/types/entity/entity.d.ts +98 -0
- package/{src/game.js → dist/types/game.d.ts} +3 -14
- package/dist/types/geometries/ellipse.d.ts +154 -0
- package/dist/types/geometries/line.d.ts +11 -0
- package/dist/types/geometries/path2d.d.ts +121 -0
- package/dist/types/geometries/point.d.ts +53 -0
- package/dist/types/geometries/poly.d.ts +222 -0
- package/dist/types/geometries/rectangle.d.ts +176 -0
- package/dist/types/geometries/roundrect.d.ts +52 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/input/gamepad.d.ts +95 -0
- package/dist/types/input/input.d.ts +15 -0
- package/dist/types/input/keyboard.d.ts +205 -0
- package/dist/types/input/pointer.d.ts +270 -0
- package/dist/types/input/pointerevent.d.ts +181 -0
- package/dist/types/lang/console.d.ts +7 -0
- package/dist/types/lang/deprecated.d.ts +45 -0
- package/dist/types/level/level.d.ts +134 -0
- package/dist/types/level/tiled/TMXGroup.d.ts +61 -0
- package/dist/types/level/tiled/TMXLayer.d.ts +158 -0
- package/dist/types/level/tiled/TMXObject.d.ts +133 -0
- package/dist/types/level/tiled/TMXTile.d.ts +64 -0
- package/dist/types/level/tiled/TMXTileMap.d.ts +142 -0
- package/dist/types/level/tiled/TMXTileset.d.ts +80 -0
- package/dist/types/level/tiled/TMXTilesetGroup.d.ts +26 -0
- package/dist/types/level/tiled/TMXUtils.d.ts +47 -0
- package/dist/types/level/tiled/constants.d.ts +5 -0
- package/dist/types/level/tiled/renderer/TMXHexagonalRenderer.d.ts +83 -0
- package/dist/types/level/tiled/renderer/TMXIsometricRenderer.d.ts +51 -0
- package/dist/types/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +43 -0
- package/dist/types/level/tiled/renderer/TMXRenderer.d.ts +63 -0
- package/dist/types/level/tiled/renderer/TMXStaggeredRenderer.d.ts +8 -0
- package/dist/types/level/tiled/renderer/autodetect.d.ts +9 -0
- package/dist/types/loader/loader.d.ts +181 -0
- package/dist/types/loader/loadingscreen.d.ts +18 -0
- package/dist/types/math/color.d.ts +170 -0
- package/dist/types/math/math.d.ts +165 -0
- package/dist/types/math/matrix2.d.ts +209 -0
- package/dist/types/math/matrix3.d.ts +236 -0
- package/dist/types/math/observable_vector2.d.ts +278 -0
- package/dist/types/math/observable_vector3.d.ts +277 -0
- package/dist/types/math/vector2.d.ts +327 -0
- package/dist/types/math/vector3.d.ts +332 -0
- package/dist/types/particles/emitter.d.ts +188 -0
- package/dist/types/particles/particle.d.ts +32 -0
- package/dist/types/particles/settings.d.ts +32 -0
- package/dist/types/physics/body.d.ts +330 -0
- package/dist/types/physics/bounds.d.ts +250 -0
- package/dist/types/physics/collision.d.ts +44 -0
- package/dist/types/physics/detector.d.ts +64 -0
- package/dist/types/physics/quadtree.d.ts +79 -0
- package/dist/types/physics/response.d.ts +37 -0
- package/dist/types/physics/sat.d.ts +48 -0
- package/dist/types/physics/world.d.ts +83 -0
- package/dist/types/plugin/plugin.d.ts +10 -0
- package/dist/types/polyfill/console.d.ts +0 -0
- package/dist/types/polyfill/index.d.ts +1 -0
- package/dist/types/polyfill/performance.d.ts +0 -0
- package/dist/types/polyfill/requestAnimationFrame.d.ts +1 -0
- package/dist/types/polyfill/roundrect.d.ts +0 -0
- package/dist/types/renderable/collectable.d.ts +19 -0
- package/dist/types/renderable/colorlayer.d.ts +28 -0
- package/dist/types/renderable/container.d.ts +302 -0
- package/dist/types/renderable/dragndrop.d.ts +118 -0
- package/dist/types/renderable/imagelayer.d.ts +106 -0
- package/dist/types/renderable/light2d.d.ts +58 -0
- package/dist/types/renderable/nineslicesprite.d.ts +59 -0
- package/dist/types/renderable/renderable.d.ts +402 -0
- package/dist/types/renderable/sprite.d.ts +268 -0
- package/dist/types/renderable/trigger.d.ts +61 -0
- package/dist/types/renderable/ui/uibaseelement.d.ts +95 -0
- package/dist/types/renderable/ui/uispriteelement.d.ts +127 -0
- package/dist/types/renderable/ui/uitextbutton.d.ts +54 -0
- package/dist/types/state/stage.d.ts +116 -0
- package/dist/types/state/state.d.ts +170 -0
- package/dist/types/system/device.d.ts +579 -0
- package/dist/types/system/dom.d.ts +1 -0
- package/dist/types/system/event.d.ts +473 -0
- package/dist/types/system/platform.d.ts +31 -0
- package/dist/types/system/pooling.d.ts +101 -0
- package/dist/types/system/save.d.ts +25 -0
- package/dist/types/system/timer.d.ts +126 -0
- package/dist/types/text/bitmaptext.d.ts +151 -0
- package/dist/types/text/bitmaptextdata.d.ts +35 -0
- package/dist/types/text/glyph.d.ts +28 -0
- package/dist/types/text/text.d.ts +173 -0
- package/dist/types/text/textmetrics.d.ts +47 -0
- package/dist/types/text/textstyle.d.ts +5 -0
- package/dist/types/tweens/easing.d.ts +46 -0
- package/dist/types/tweens/interpolation.d.ts +18 -0
- package/dist/types/tweens/tween.d.ts +195 -0
- package/dist/types/utils/agent.d.ts +21 -0
- package/dist/types/utils/array.d.ts +39 -0
- package/dist/types/utils/file.d.ts +18 -0
- package/dist/types/utils/function.d.ts +32 -0
- package/dist/types/utils/string.d.ts +50 -0
- package/dist/types/utils/utils.d.ts +17 -0
- package/dist/types/video/canvas/canvas_renderer.d.ts +380 -0
- package/dist/types/video/renderer.d.ts +222 -0
- package/dist/types/video/texture/atlas.d.ts +201 -0
- package/dist/types/video/texture/cache.d.ts +45 -0
- package/dist/types/video/texture/canvas_texture.d.ts +78 -0
- package/dist/types/video/utils/autodetect.d.ts +7 -0
- package/dist/types/video/utils/resize.d.ts +4 -0
- package/dist/types/video/video.d.ts +93 -0
- package/dist/types/video/webgl/buffer/vertex.d.ts +56 -0
- package/dist/types/video/webgl/glshader.d.ts +93 -0
- package/dist/types/video/webgl/utils/attributes.d.ts +4 -0
- package/dist/types/video/webgl/utils/precision.d.ts +13 -0
- package/dist/types/video/webgl/utils/program.d.ts +5 -0
- package/dist/types/video/webgl/utils/string.d.ts +5 -0
- package/dist/types/video/webgl/utils/uniforms.d.ts +4 -0
- package/dist/types/video/webgl/webgl_compositor.d.ts +174 -0
- package/dist/types/video/webgl/webgl_renderer.d.ts +429 -0
- package/package.json +8 -8
- package/src/application/application.js +138 -7
- package/src/application/header.js +25 -0
- package/src/{video/utils → application}/resize.js +11 -6
- package/src/application/settings.js +19 -0
- package/src/camera/camera2d.js +1 -1
- package/src/const.js +23 -0
- package/src/index.js +36 -23
- package/src/input/pointer.js +1 -1
- package/src/input/pointerevent.js +1 -1
- package/src/lang/console.js +36 -0
- package/src/lang/deprecated.js +2 -37
- package/src/level/level.js +1 -1
- package/src/level/tiled/TMXGroup.js +0 -21
- package/src/level/tiled/TMXLayer.js +66 -56
- package/src/level/tiled/TMXObject.js +0 -62
- package/src/level/tiled/TMXTile.js +8 -24
- package/src/level/tiled/TMXTileMap.js +17 -83
- package/src/level/tiled/TMXTileset.js +0 -14
- package/src/level/tiled/TMXTilesetGroup.js +1 -9
- package/src/level/tiled/TMXUtils.js +38 -15
- package/src/level/tiled/constants.js +8 -0
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +5 -6
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -4
- package/src/level/tiled/renderer/TMXRenderer.js +0 -12
- package/src/level/tiled/renderer/autodetect.js +29 -0
- package/src/loader/loader.js +3 -1
- package/src/loader/loadingscreen.js +1 -1
- package/src/physics/collision.js +2 -2
- package/src/physics/detector.js +172 -145
- package/src/physics/world.js +10 -30
- package/src/renderable/container.js +7 -91
- package/src/renderable/imagelayer.js +1 -1
- package/src/renderable/trigger.js +1 -1
- package/src/renderable/ui/uibaseelement.js +1 -1
- package/src/state/stage.js +1 -1
- package/src/state/state.js +1 -1
- package/src/system/device.js +0 -20
- package/src/tweens/tween.js +1 -1
- package/src/video/canvas/canvas_renderer.js +3 -0
- package/src/video/renderer.js +7 -0
- package/src/video/texture/canvas_texture.js +2 -1
- package/src/video/utils/autodetect.js +18 -0
- package/src/video/video.js +26 -155
- package/src/video/webgl/glshader.js +3 -4
- package/src/video/webgl/utils/precision.js +18 -0
- package/src/video/webgl/webgl_renderer.js +3 -0
- package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-end.js +0 -13
- package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-start.js +0 -13
- package/dist/melonjs.mjs/node_modules/core-js/internals/a-callable.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/an-object.js +0 -21
- package/dist/melonjs.mjs/node_modules/core-js/internals/array-includes.js +0 -45
- package/dist/melonjs.mjs/node_modules/core-js/internals/classof-raw.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/classof.js +0 -43
- package/dist/melonjs.mjs/node_modules/core-js/internals/copy-constructor-properties.js +0 -32
- package/dist/melonjs.mjs/node_modules/core-js/internals/create-non-enumerable-property.js +0 -24
- package/dist/melonjs.mjs/node_modules/core-js/internals/create-property-descriptor.js +0 -17
- package/dist/melonjs.mjs/node_modules/core-js/internals/define-built-in.js +0 -43
- package/dist/melonjs.mjs/node_modules/core-js/internals/define-global-property.js +0 -23
- package/dist/melonjs.mjs/node_modules/core-js/internals/descriptors.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/document-all.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/document-create-element.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/engine-user-agent.js +0 -14
- package/dist/melonjs.mjs/node_modules/core-js/internals/engine-v8-version.js +0 -39
- package/dist/melonjs.mjs/node_modules/core-js/internals/entry-unbind.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/enum-bug-keys.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/export.js +0 -72
- package/dist/melonjs.mjs/node_modules/core-js/internals/fails.js +0 -16
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-bind-native.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-call.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-name.js +0 -29
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-uncurry-this.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/get-built-in.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/get-method.js +0 -21
- package/dist/melonjs.mjs/node_modules/core-js/internals/global.js +0 -25
- package/dist/melonjs.mjs/node_modules/core-js/internals/has-own-property.js +0 -23
- package/dist/melonjs.mjs/node_modules/core-js/internals/hidden-keys.js +0 -10
- package/dist/melonjs.mjs/node_modules/core-js/internals/ie8-dom-define.js +0 -24
- package/dist/melonjs.mjs/node_modules/core-js/internals/indexed-object.js +0 -28
- package/dist/melonjs.mjs/node_modules/core-js/internals/inspect-source.js +0 -27
- package/dist/melonjs.mjs/node_modules/core-js/internals/internal-state.js +0 -88
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-callable.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-forced.js +0 -34
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-null-or-undefined.js +0 -14
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-object.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-symbol.js +0 -27
- package/dist/melonjs.mjs/node_modules/core-js/internals/length-of-array-like.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/make-built-in.js +0 -68
- package/dist/melonjs.mjs/node_modules/core-js/internals/math-trunc.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-define-property.js +0 -58
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-descriptor.js +0 -41
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-names.js +0 -23
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-symbols.js +0 -12
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-is-prototype-of.js +0 -14
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-keys-internal.js +0 -35
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-property-is-enumerable.js +0 -23
- package/dist/melonjs.mjs/node_modules/core-js/internals/ordinary-to-primitive.js +0 -28
- package/dist/melonjs.mjs/node_modules/core-js/internals/own-keys.js +0 -31
- package/dist/melonjs.mjs/node_modules/core-js/internals/require-object-coercible.js +0 -21
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared-key.js +0 -21
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared-store.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared.js +0 -24
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-end.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-forced.js +0 -28
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-start.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim.js +0 -45
- package/dist/melonjs.mjs/node_modules/core-js/internals/symbol-constructor-detection.js +0 -26
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-absolute-index.js +0 -23
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-indexed-object.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-integer-or-infinity.js +0 -20
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-length.js +0 -20
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-object.js +0 -20
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-primitive.js +0 -41
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-property-key.js +0 -21
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-string-tag-support.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-string.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/internals/try-to-string.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/uid.js +0 -20
- package/dist/melonjs.mjs/node_modules/core-js/internals/use-symbol-as-uid.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/v8-prototype-define-bug.js +0 -24
- package/dist/melonjs.mjs/node_modules/core-js/internals/weak-map-basic-detection.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/internals/well-known-symbol.js +0 -41
- package/dist/melonjs.mjs/node_modules/core-js/internals/whitespaces.js +0 -12
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.global-this.js +0 -18
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-end.js +0 -22
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-left.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-right.js +0 -19
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-start.js +0 -22
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.mjs.js +0 -9
|
@@ -1,34 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
|
-
import * as audio from './audio/audio.js';
|
|
9
|
-
export { audio };
|
|
10
|
-
export { default as collision } from './physics/collision.js';
|
|
11
|
-
import { emit, BOOT } from './system/event.js';
|
|
12
|
-
import * as event from './system/event.js';
|
|
13
|
-
export { event };
|
|
14
|
-
import { onReady } from './system/device.js';
|
|
15
|
-
import * as device from './system/device.js';
|
|
16
|
-
export { device };
|
|
17
|
-
export { default as game } from './game.js';
|
|
18
|
-
import loader from './loader/loader.js';
|
|
19
|
-
import * as math from './math/math.js';
|
|
20
|
-
export { math as Math };
|
|
21
|
-
import utils from './utils/utils.js';
|
|
22
|
-
import * as input from './input/input.js';
|
|
23
|
-
export { input };
|
|
24
|
-
export { plugin, plugins } from './plugin/plugin.js';
|
|
25
|
-
import * as video from './video/video.js';
|
|
26
|
-
export { video };
|
|
27
|
-
export { default as save } from './system/save.js';
|
|
28
|
-
export { default as timer } from './system/timer.js';
|
|
29
|
-
import pool from './system/pooling.js';
|
|
30
|
-
export { default as state } from './state/state.js';
|
|
31
|
-
export { default as level } from './level/level.js';
|
|
32
8
|
import Color from './math/color.js';
|
|
33
9
|
import Vector2d from './math/vector2.js';
|
|
34
10
|
import Vector3d from './math/vector3.js';
|
|
@@ -54,9 +30,6 @@ export { default as CanvasRenderer } from './video/canvas/canvas_renderer.js';
|
|
|
54
30
|
import CanvasTexture from './video/texture/canvas_texture.js';
|
|
55
31
|
export { TextureAtlas } from './video/texture/atlas.js';
|
|
56
32
|
import Renderable from './renderable/renderable.js';
|
|
57
|
-
import Text from './text/text.js';
|
|
58
|
-
import BitmapText from './text/bitmaptext.js';
|
|
59
|
-
import BitmapTextData from './text/bitmaptextdata.js';
|
|
60
33
|
import ColorLayer from './renderable/colorlayer.js';
|
|
61
34
|
import ImageLayer from './renderable/imagelayer.js';
|
|
62
35
|
import Sprite from './renderable/sprite.js';
|
|
@@ -67,6 +40,9 @@ export { default as UISpriteElement } from './renderable/ui/uispriteelement.js';
|
|
|
67
40
|
import Collectable from './renderable/collectable.js';
|
|
68
41
|
import Trigger from './renderable/trigger.js';
|
|
69
42
|
import Light2d from './renderable/light2d.js';
|
|
43
|
+
import Text from './text/text.js';
|
|
44
|
+
import BitmapText from './text/bitmaptext.js';
|
|
45
|
+
import BitmapTextData from './text/bitmaptextdata.js';
|
|
70
46
|
export { Draggable, DropTarget } from './renderable/dragndrop.js';
|
|
71
47
|
export { default as TMXRenderer } from './level/tiled/renderer/TMXRenderer.js';
|
|
72
48
|
export { default as TMXOrthogonalRenderer } from './level/tiled/renderer/TMXOrthogonalRenderer.js';
|
|
@@ -87,7 +63,32 @@ export { default as ParticleEmitterSettings } from './particles/settings.js';
|
|
|
87
63
|
export { default as ParticleEmitter } from './particles/emitter.js';
|
|
88
64
|
import Particle from './particles/particle.js';
|
|
89
65
|
import Entity from './entity/entity.js';
|
|
90
|
-
|
|
66
|
+
import Application from './application/application.js';
|
|
67
|
+
import * as audio from './audio/audio.js';
|
|
68
|
+
export { audio };
|
|
69
|
+
export { default as collision } from './physics/collision.js';
|
|
70
|
+
import { emit, BOOT } from './system/event.js';
|
|
71
|
+
import * as event from './system/event.js';
|
|
72
|
+
export { event };
|
|
73
|
+
import { onReady } from './system/device.js';
|
|
74
|
+
import * as device from './system/device.js';
|
|
75
|
+
export { device };
|
|
76
|
+
import loader from './loader/loader.js';
|
|
77
|
+
import * as math from './math/math.js';
|
|
78
|
+
export { math as Math };
|
|
79
|
+
import utils from './utils/utils.js';
|
|
80
|
+
import * as input from './input/input.js';
|
|
81
|
+
export { input };
|
|
82
|
+
export { plugin, plugins } from './plugin/plugin.js';
|
|
83
|
+
import * as video from './video/video.js';
|
|
84
|
+
export { video };
|
|
85
|
+
export { default as save } from './system/save.js';
|
|
86
|
+
export { default as timer } from './system/timer.js';
|
|
87
|
+
import pool from './system/pooling.js';
|
|
88
|
+
export { default as state } from './state/state.js';
|
|
89
|
+
export { default as level } from './level/level.js';
|
|
90
|
+
export { DraggableEntity, DroptargetEntity, GUI_Object } from './lang/deprecated.js';
|
|
91
|
+
export { AUTO, CANVAS, WEBGL } from './const.js';
|
|
91
92
|
import { initKeyboardEvent } from './input/keyboard.js';
|
|
92
93
|
|
|
93
94
|
// ES5/ES6 polyfills
|
|
@@ -100,8 +101,7 @@ import { initKeyboardEvent } from './input/keyboard.js';
|
|
|
100
101
|
* @name version
|
|
101
102
|
* @type {string}
|
|
102
103
|
*/
|
|
103
|
-
const version = "14.
|
|
104
|
-
|
|
104
|
+
const version = "14.4.0";
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* a flag indicating that melonJS is fully initialized
|
|
@@ -119,6 +119,14 @@ var initialized = false;
|
|
|
119
119
|
*/
|
|
120
120
|
var skipAutoInit = false;
|
|
121
121
|
|
|
122
|
+
/*
|
|
123
|
+
* game is a default instance of a melonJS Application and represents your current game,
|
|
124
|
+
* it contains all the objects, tilemap layers, current viewport, collision map, etc...<br>
|
|
125
|
+
* @namespace game
|
|
126
|
+
* @see Application
|
|
127
|
+
*/
|
|
128
|
+
const game = new Application(0, 0, {legacy:true});
|
|
129
|
+
|
|
122
130
|
/**
|
|
123
131
|
* initialize the melonJS library.
|
|
124
132
|
* this is automatically called unless me.skipAutoInit is set to true,
|
|
@@ -133,6 +141,9 @@ function boot() {
|
|
|
133
141
|
return;
|
|
134
142
|
}
|
|
135
143
|
|
|
144
|
+
// output melonJS version in the console
|
|
145
|
+
console.log("melonJS 2 (v" + version + ") | http://melonjs.org" );
|
|
146
|
+
|
|
136
147
|
// register all built-ins objects into the object pool
|
|
137
148
|
pool.register("me.Entity", Entity);
|
|
138
149
|
pool.register("me.Collectable", Collectable);
|
|
@@ -214,4 +225,4 @@ onReady(() => {
|
|
|
214
225
|
}
|
|
215
226
|
});
|
|
216
227
|
|
|
217
|
-
export { BitmapText, BitmapTextData, Bounds, Collectable, Color, ColorLayer, Ellipse, Entity, ImageLayer, Light2d, Line, Matrix2d, Matrix3d, NineSliceSprite, ObservableVector2d, ObservableVector3d, Particle, Point, Polygon, Rect, Renderable, RoundRect, Sprite, Text, Trigger, Tween, Vector2d, Vector3d, boot, initialized, loader, pool, skipAutoInit, utils, version };
|
|
228
|
+
export { Application, BitmapText, BitmapTextData, Bounds, Collectable, Color, ColorLayer, Ellipse, Entity, ImageLayer, Light2d, Line, Matrix2d, Matrix3d, NineSliceSprite, ObservableVector2d, ObservableVector3d, Particle, Point, Polygon, Rect, Renderable, RoundRect, Sprite, Text, Trigger, Tween, Vector2d, Vector3d, boot, game, initialized, loader, pool, skipAutoInit, utils, version };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { getBindingKey, triggerKeyEvent } from './keyboard.js';
|
|
9
9
|
import { emit, GAMEPAD_CONNECTED, GAMEPAD_DISCONNECTED, on, GAME_BEFORE_UPDATE, GAMEPAD_UPDATE } from '../system/event.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
export { bindPointer, exitPointerLock, globalToLocal, locked, pointer, pointerEventTarget, registerPointerEvent, releaseAllPointerEvents, releasePointerEvent, requestPointerLock, setTouchAction, throttlingInterval, unbindPointer } from './pointerevent.js';
|
|
9
9
|
export { KEY, bindKey, getBindingKey, initKeyboardEvent, isKeyPressed, keyBoardEventTarget, keyStatus, triggerKeyEvent, unbindKey, unlockKey } from './keyboard.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { preventDefault } from './input.js';
|
|
9
9
|
import { emit, KEYDOWN, KEYUP } from '../system/event.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import Vector2d from '../math/vector2.js';
|
|
9
9
|
import Bounds from '../physics/bounds.js';
|
|
10
|
-
import game from '../
|
|
10
|
+
import { game } from '../index.js';
|
|
11
11
|
import { globalToLocal, locked } from './pointerevent.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { preventDefault } from './input.js';
|
|
9
9
|
import { getBindingKey, triggerKeyEvent } from './keyboard.js';
|
|
@@ -16,7 +16,7 @@ import pool from '../system/pooling.js';
|
|
|
16
16
|
import { getElementBounds, hasPointerLockSupport, maxTouchPoints, pointerEvent, touch, focus, touchEvent } from '../system/device.js';
|
|
17
17
|
import Pointer from './pointer.js';
|
|
18
18
|
import Rect from '../geometries/rectangle.js';
|
|
19
|
-
import game from '../
|
|
19
|
+
import { game } from '../index.js';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* A pool of `Pointer` objects to cache pointer/touch event coordinates.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* melonJS Game Engine - v14.4.0
|
|
3
|
+
* http://www.melonjs.org
|
|
4
|
+
* melonjs is licensed under the MIT License.
|
|
5
|
+
* http://www.opensource.org/licenses/mit-license
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* display a deprecation warning in the console
|
|
10
|
+
* @param {string} deprecated - deprecated class,function or property name
|
|
11
|
+
* @param {string} replacement - the replacement class, function, or property name
|
|
12
|
+
* @param {string} version - the version since when the lass,function or property is deprecated
|
|
13
|
+
*/
|
|
14
|
+
function warning(deprecated, replacement, version) {
|
|
15
|
+
var msg = "melonJS: %s is deprecated since version %s, please use %s";
|
|
16
|
+
var stack = new Error().stack;
|
|
17
|
+
|
|
18
|
+
if (console.groupCollapsed) {
|
|
19
|
+
console.groupCollapsed(
|
|
20
|
+
"%c" + msg,
|
|
21
|
+
"font-weight:normal;color:yellow;",
|
|
22
|
+
deprecated,
|
|
23
|
+
version,
|
|
24
|
+
replacement
|
|
25
|
+
);
|
|
26
|
+
} else {
|
|
27
|
+
console.warn(
|
|
28
|
+
msg,
|
|
29
|
+
deprecated,
|
|
30
|
+
version,
|
|
31
|
+
replacement
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (typeof stack !== "undefined") {
|
|
36
|
+
console.warn(stack);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (console.groupCollapsed) {
|
|
40
|
+
console.groupEnd();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { warning };
|
|
@@ -1,56 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { TextureAtlas } from '../video/texture/atlas.js';
|
|
9
9
|
import Renderer from '../video/renderer.js';
|
|
10
10
|
import { Draggable, DropTarget } from '../renderable/dragndrop.js';
|
|
11
11
|
import UISpriteElement from '../renderable/ui/uispriteelement.js';
|
|
12
|
+
import { warning } from './console.js';
|
|
12
13
|
|
|
13
14
|
/*
|
|
14
15
|
* placeholder for all deprecated classes and corresponding alias for backward compatibility
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
-
* display a deprecation warning in the console
|
|
19
|
-
* @ignore
|
|
20
|
-
* @param {string} deprecated - deprecated class,function or property name
|
|
21
|
-
* @param {string} replacement - the replacement class, function, or property name
|
|
22
|
-
* @param {string} version - the version since when the lass,function or property is deprecated
|
|
23
|
-
*/
|
|
24
|
-
function warning(deprecated, replacement, version) {
|
|
25
|
-
var msg = "melonJS: %s is deprecated since version %s, please use %s";
|
|
26
|
-
var stack = new Error().stack;
|
|
27
|
-
|
|
28
|
-
if (console.groupCollapsed) {
|
|
29
|
-
console.groupCollapsed(
|
|
30
|
-
"%c" + msg,
|
|
31
|
-
"font-weight:normal;color:yellow;",
|
|
32
|
-
deprecated,
|
|
33
|
-
version,
|
|
34
|
-
replacement
|
|
35
|
-
);
|
|
36
|
-
} else {
|
|
37
|
-
console.warn(
|
|
38
|
-
msg,
|
|
39
|
-
deprecated,
|
|
40
|
-
version,
|
|
41
|
-
replacement
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (typeof stack !== "undefined") {
|
|
46
|
-
console.warn(stack);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (console.groupCollapsed) {
|
|
50
|
-
console.groupEnd();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
18
|
/**
|
|
55
19
|
* Alias of {@link TextureAtlas}
|
|
56
20
|
* @public
|
|
@@ -154,4 +118,4 @@ Renderer.prototype.getScreenContext = function() {
|
|
|
154
118
|
}
|
|
155
119
|
}
|
|
156
120
|
|
|
157
|
-
export { DraggableEntity, DroptargetEntity, GUI_Object
|
|
121
|
+
export { DraggableEntity, DroptargetEntity, GUI_Object };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import utils from '../utils/utils.js';
|
|
9
9
|
import { emit, LEVEL_LOADED } from '../system/event.js';
|
|
10
10
|
import state from '../state/state.js';
|
|
11
11
|
import loader from '../loader/loader.js';
|
|
12
|
-
import game from '../
|
|
12
|
+
import { game } from '../index.js';
|
|
13
13
|
import TMXTileMap from './tiled/TMXTileMap.js';
|
|
14
14
|
|
|
15
15
|
// our levels
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { applyTMXProperties } from './TMXUtils.js';
|
|
9
9
|
import TMXObject from './TMXObject.js';
|
|
@@ -22,66 +22,45 @@ class TMXGroup {
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* group name
|
|
25
|
-
* @public
|
|
26
25
|
* @type {string}
|
|
27
|
-
* @name name
|
|
28
|
-
* @memberof TMXGroup
|
|
29
26
|
*/
|
|
30
27
|
this.name = data.name;
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
30
|
* group width
|
|
34
|
-
* @public
|
|
35
31
|
* @type {number}
|
|
36
|
-
* @name width
|
|
37
|
-
* @memberof TMXGroup
|
|
38
32
|
*/
|
|
39
33
|
this.width = data.width || 0;
|
|
40
34
|
|
|
41
35
|
/**
|
|
42
36
|
* group height
|
|
43
|
-
* @public
|
|
44
37
|
* @type {number}
|
|
45
|
-
* @name height
|
|
46
|
-
* @memberof TMXGroup
|
|
47
38
|
*/
|
|
48
39
|
this.height = data.height || 0;
|
|
49
40
|
|
|
50
41
|
/**
|
|
51
42
|
* tint color
|
|
52
|
-
* @public
|
|
53
43
|
* @type {string}
|
|
54
|
-
* @name tintcolor
|
|
55
|
-
* @memberof TMXGroup
|
|
56
44
|
*/
|
|
57
45
|
this.tintcolor = data.tintcolor;
|
|
58
46
|
|
|
59
47
|
|
|
60
48
|
/**
|
|
61
49
|
* the group class
|
|
62
|
-
* @public
|
|
63
50
|
* @type {string}
|
|
64
|
-
* @name class
|
|
65
|
-
* @memberof TMXGroup
|
|
66
51
|
*/
|
|
67
52
|
this.class = data.class;
|
|
68
53
|
|
|
69
54
|
/**
|
|
70
55
|
* group z order
|
|
71
|
-
* @public
|
|
72
56
|
* @type {number}
|
|
73
|
-
* @name z
|
|
74
|
-
* @memberof TMXGroup
|
|
75
57
|
*/
|
|
76
58
|
this.z = z;
|
|
77
59
|
|
|
78
60
|
/**
|
|
79
61
|
* group objects list definition
|
|
80
62
|
* @see TMXObject
|
|
81
|
-
* @public
|
|
82
63
|
* @type {object[]}
|
|
83
|
-
* @name name
|
|
84
|
-
* @memberof TMXGroup
|
|
85
64
|
*/
|
|
86
65
|
this.objects = [];
|
|
87
66
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v14.
|
|
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 -
|
|
6
|
+
* @copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
|
|
7
7
|
*/
|
|
8
8
|
import { createCanvas } from '../../video/video.js';
|
|
9
9
|
import pool from '../../system/pooling.js';
|
|
@@ -11,40 +11,49 @@ import { applyTMXProperties, decode } from './TMXUtils.js';
|
|
|
11
11
|
import Tile from './TMXTile.js';
|
|
12
12
|
import Renderable from '../../renderable/renderable.js';
|
|
13
13
|
import CanvasRenderer from '../../video/canvas/canvas_renderer.js';
|
|
14
|
-
import game from '../../
|
|
14
|
+
import { game } from '../../index.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Create required arrays for the given layer object
|
|
18
18
|
* @ignore
|
|
19
19
|
*/
|
|
20
|
-
function initArray(
|
|
20
|
+
function initArray(rows, cols) {
|
|
21
21
|
// initialize the array
|
|
22
|
-
|
|
23
|
-
for (var
|
|
24
|
-
|
|
25
|
-
for (var
|
|
26
|
-
|
|
22
|
+
var array = new Array(cols);
|
|
23
|
+
for (var col = 0; col < cols; col++) {
|
|
24
|
+
array[col] = new Array(rows);
|
|
25
|
+
for (var row = 0; row < rows; row++) {
|
|
26
|
+
array[col][row] = null;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
return array;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Set a tiled layer Data
|
|
33
34
|
* @ignore
|
|
34
35
|
*/
|
|
35
|
-
function setLayerData(layer, data) {
|
|
36
|
+
function setLayerData(layer, bounds, data) {
|
|
36
37
|
var idx = 0;
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
var width, height;
|
|
39
|
+
|
|
40
|
+
// layer provide rows and cols, chunk width and height
|
|
41
|
+
if (typeof bounds.rows === "undefined") {
|
|
42
|
+
width = bounds.width;
|
|
43
|
+
height = bounds.height;
|
|
44
|
+
} else {
|
|
45
|
+
width = bounds.cols;
|
|
46
|
+
height = bounds.rows;
|
|
47
|
+
}
|
|
39
48
|
// set everything
|
|
40
|
-
for (var y = 0; y <
|
|
41
|
-
for (var x = 0; x <
|
|
49
|
+
for (var y = 0; y < height; y++) {
|
|
50
|
+
for (var x = 0; x < width; x++) {
|
|
42
51
|
// get the value of the gid
|
|
43
52
|
var gid = data[idx++];
|
|
44
53
|
// fill the array
|
|
45
54
|
if (gid !== 0) {
|
|
46
55
|
// add a new tile to the layer
|
|
47
|
-
layer.layerData[x][y] = layer.getTileById(gid, x, y);
|
|
56
|
+
layer.layerData[x + bounds.x][y + bounds.y] = layer.getTileById(gid, x + bounds.x, y + bounds.y);
|
|
48
57
|
}
|
|
49
58
|
}
|
|
50
59
|
}
|
|
@@ -96,11 +105,23 @@ function preRenderLayer(layer, renderer) {
|
|
|
96
105
|
// layer orientation
|
|
97
106
|
this.orientation = orientation;
|
|
98
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Horizontal layer offset in tiles
|
|
110
|
+
* @default 0
|
|
111
|
+
* @type {number}
|
|
112
|
+
*/
|
|
113
|
+
this.x = 0;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Vertical layer offset in tiles
|
|
117
|
+
* @default 0
|
|
118
|
+
* @type {number}
|
|
119
|
+
*/
|
|
120
|
+
this.y = 0;
|
|
121
|
+
|
|
99
122
|
/**
|
|
100
123
|
* The Layer corresponding Tilesets
|
|
101
|
-
* @public
|
|
102
124
|
* @type {TMXTilesetGroup}
|
|
103
|
-
* @name TMXLayer#tilesets
|
|
104
125
|
*/
|
|
105
126
|
this.tilesets = tilesets;
|
|
106
127
|
|
|
@@ -121,36 +142,27 @@ function preRenderLayer(layer, renderer) {
|
|
|
121
142
|
|
|
122
143
|
/**
|
|
123
144
|
* All animated tilesets in this layer
|
|
124
|
-
* @ignore
|
|
125
145
|
* @type {TMXTileset[]}
|
|
126
|
-
* @name TMXLayer#animatedTilesets
|
|
127
146
|
*/
|
|
128
147
|
this.animatedTilesets = [];
|
|
129
148
|
|
|
130
149
|
/**
|
|
131
150
|
* Layer contains tileset animations
|
|
132
|
-
* @public
|
|
133
151
|
* @type {boolean}
|
|
134
|
-
* @name TMXLayer#isAnimated
|
|
135
152
|
*/
|
|
136
153
|
this.isAnimated = false;
|
|
137
154
|
|
|
138
155
|
/**
|
|
139
156
|
* the order in which tiles on orthogonal tile layers are rendered.
|
|
140
157
|
* (valid values are "left-down", "left-up", "right-down", "right-up")
|
|
141
|
-
* @public
|
|
142
158
|
* @type {string}
|
|
143
159
|
* @default "right-down"
|
|
144
|
-
* @name TMXLayer#renderorder
|
|
145
160
|
*/
|
|
146
161
|
this.renderorder = data.renderorder || "right-down";
|
|
147
162
|
|
|
148
163
|
/**
|
|
149
164
|
* the layer class
|
|
150
|
-
* @public
|
|
151
165
|
* @type {string}
|
|
152
|
-
* @name class
|
|
153
|
-
* @name TMXLayer#class
|
|
154
166
|
*/
|
|
155
167
|
this.class = data.class;
|
|
156
168
|
|
|
@@ -196,14 +208,36 @@ function preRenderLayer(layer, renderer) {
|
|
|
196
208
|
this.setRenderer(map.getRenderer());
|
|
197
209
|
|
|
198
210
|
|
|
199
|
-
// initialize
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
// initialize the data array
|
|
212
|
+
this.layerData = initArray(this.rows, this.cols);
|
|
213
|
+
|
|
214
|
+
if (map.infinite === 0) {
|
|
215
|
+
// initialize and set the layer data
|
|
216
|
+
setLayerData(
|
|
217
|
+
this,
|
|
218
|
+
this,
|
|
219
|
+
decode(
|
|
220
|
+
data.data,
|
|
221
|
+
data.encoding,
|
|
222
|
+
data.compression
|
|
223
|
+
)
|
|
224
|
+
);
|
|
225
|
+
} else if (map.infinite === 1) {
|
|
226
|
+
// infinite map, initialize per chunk
|
|
227
|
+
data.chunks.forEach((chunk) => {
|
|
228
|
+
// initialize and set the layer data
|
|
229
|
+
setLayerData(
|
|
230
|
+
this,
|
|
231
|
+
chunk,
|
|
232
|
+
decode(
|
|
233
|
+
chunk.data,
|
|
234
|
+
data.encoding,
|
|
235
|
+
data.compression
|
|
236
|
+
)
|
|
237
|
+
);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
207
241
|
}
|
|
208
242
|
|
|
209
243
|
|
|
@@ -255,9 +289,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
255
289
|
|
|
256
290
|
/**
|
|
257
291
|
* Set the TMX renderer for this layer object
|
|
258
|
-
* @name setRenderer
|
|
259
|
-
* @memberof TMXLayer
|
|
260
|
-
* @public
|
|
261
292
|
* @param {TMXRenderer} renderer
|
|
262
293
|
* @example
|
|
263
294
|
* // use the parent map default renderer
|
|
@@ -270,9 +301,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
270
301
|
|
|
271
302
|
/**
|
|
272
303
|
* Return the layer current renderer object
|
|
273
|
-
* @name getRenderer
|
|
274
|
-
* @memberof TMXLayer
|
|
275
|
-
* @public
|
|
276
304
|
* @returns {TMXRenderer} renderer
|
|
277
305
|
*/
|
|
278
306
|
getRenderer() {
|
|
@@ -282,9 +310,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
282
310
|
|
|
283
311
|
/**
|
|
284
312
|
* Return the TileId of the Tile at the specified position
|
|
285
|
-
* @name getTileId
|
|
286
|
-
* @memberof TMXLayer
|
|
287
|
-
* @public
|
|
288
313
|
* @param {number} x - X coordinate (in world/pixels coordinates)
|
|
289
314
|
* @param {number} y - Y coordinate (in world/pixels coordinates)
|
|
290
315
|
* @returns {number} TileId or null if there is no Tile at the given position
|
|
@@ -296,9 +321,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
296
321
|
|
|
297
322
|
/**
|
|
298
323
|
* Return the Tile object at the specified position
|
|
299
|
-
* @name getTile
|
|
300
|
-
* @memberof TMXLayer
|
|
301
|
-
* @public
|
|
302
324
|
* @param {number} x - X coordinate (in world/pixels coordinates)
|
|
303
325
|
* @param {number} y - Y coordinate (in world/pixels coordinates)
|
|
304
326
|
* @returns {Tile} corresponding tile or null if there is no defined tile at the coordinate or if outside of the layer bounds
|
|
@@ -321,9 +343,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
321
343
|
|
|
322
344
|
/**
|
|
323
345
|
* assign the given Tile object to the specified position
|
|
324
|
-
* @name getTile
|
|
325
|
-
* @memberof TMXLayer
|
|
326
|
-
* @public
|
|
327
346
|
* @param {Tile} tile - the tile object to be assigned
|
|
328
347
|
* @param {number} x - x coordinate (in world/pixels coordinates)
|
|
329
348
|
* @param {number} y - y coordinate (in world/pixels coordinates)
|
|
@@ -336,9 +355,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
336
355
|
|
|
337
356
|
/**
|
|
338
357
|
* return a new the Tile object corresponding to the given tile id
|
|
339
|
-
* @name setTile
|
|
340
|
-
* @memberof TMXLayer
|
|
341
|
-
* @public
|
|
342
358
|
* @param {number} tileId - tileId
|
|
343
359
|
* @param {number} x - X coordinate (in world/pixels coordinates)
|
|
344
360
|
* @param {number} y - Y coordinate (in world/pixels coordinates)
|
|
@@ -354,9 +370,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
354
370
|
|
|
355
371
|
/**
|
|
356
372
|
* Return the Tile object at the specified tile coordinates
|
|
357
|
-
* @name cellAt
|
|
358
|
-
* @memberof TMXLayer
|
|
359
|
-
* @public
|
|
360
373
|
* @param {number} x - x position of the tile (in Tile unit)
|
|
361
374
|
* @param {number} y - x position of the tile (in Tile unit)
|
|
362
375
|
* @param {number} [boundsCheck=true] - check first if within the layer bounds
|
|
@@ -380,9 +393,6 @@ function preRenderLayer(layer, renderer) {
|
|
|
380
393
|
|
|
381
394
|
/**
|
|
382
395
|
* clear the tile at the specified position
|
|
383
|
-
* @name clearTile
|
|
384
|
-
* @memberof TMXLayer
|
|
385
|
-
* @public
|
|
386
396
|
* @param {number} x - X coordinate (in map coordinates: row/column)
|
|
387
397
|
* @param {number} y - Y coordinate (in map coordinates: row/column)
|
|
388
398
|
* @example
|