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,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 pool from '../../system/pooling.js';
|
|
9
9
|
import { applyTMXProperties } from './TMXUtils.js';
|
|
@@ -22,185 +22,125 @@ class TMXObject {
|
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* point list in JSON format
|
|
25
|
-
* @public
|
|
26
25
|
* @type {object[]}
|
|
27
|
-
* @name points
|
|
28
|
-
* @memberof TMXObject
|
|
29
26
|
*/
|
|
30
27
|
this.points = undefined;
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
30
|
* object name
|
|
34
|
-
* @public
|
|
35
31
|
* @type {string}
|
|
36
|
-
* @name name
|
|
37
|
-
* @memberof TMXObject
|
|
38
32
|
*/
|
|
39
33
|
this.name = settings.name;
|
|
40
34
|
|
|
41
35
|
/**
|
|
42
36
|
* object x position
|
|
43
|
-
* @public
|
|
44
37
|
* @type {number}
|
|
45
|
-
* @name x
|
|
46
|
-
* @memberof TMXObject
|
|
47
38
|
*/
|
|
48
39
|
this.x = +settings.x;
|
|
49
40
|
|
|
50
41
|
/**
|
|
51
42
|
* object y position
|
|
52
|
-
* @public
|
|
53
43
|
* @type {number}
|
|
54
|
-
* @name y
|
|
55
|
-
* @memberof TMXObject
|
|
56
44
|
*/
|
|
57
45
|
this.y = +settings.y;
|
|
58
46
|
|
|
59
47
|
/**
|
|
60
48
|
* object z order
|
|
61
|
-
* @public
|
|
62
49
|
* @type {number}
|
|
63
|
-
* @name z
|
|
64
|
-
* @memberof TMXObject
|
|
65
50
|
*/
|
|
66
51
|
this.z = +z;
|
|
67
52
|
|
|
68
53
|
/**
|
|
69
54
|
* object width
|
|
70
|
-
* @public
|
|
71
55
|
* @type {number}
|
|
72
|
-
* @name width
|
|
73
|
-
* @memberof TMXObject
|
|
74
56
|
*/
|
|
75
57
|
this.width = +settings.width || 0;
|
|
76
58
|
|
|
77
59
|
/**
|
|
78
60
|
* object height
|
|
79
|
-
* @public
|
|
80
61
|
* @type {number}
|
|
81
|
-
* @name height
|
|
82
|
-
* @memberof TMXObject
|
|
83
62
|
*/
|
|
84
63
|
this.height = +settings.height || 0;
|
|
85
64
|
|
|
86
65
|
/**
|
|
87
66
|
* object gid value
|
|
88
67
|
* when defined the object is a tiled object
|
|
89
|
-
* @public
|
|
90
68
|
* @type {number}
|
|
91
|
-
* @name gid
|
|
92
|
-
* @memberof TMXObject
|
|
93
69
|
*/
|
|
94
70
|
this.gid = +settings.gid || null;
|
|
95
71
|
|
|
96
72
|
/**
|
|
97
73
|
* tint color
|
|
98
|
-
* @public
|
|
99
74
|
* @type {string}
|
|
100
|
-
* @name tintcolor
|
|
101
|
-
* @memberof TMXObject
|
|
102
75
|
*/
|
|
103
76
|
this.tintcolor = settings.tintcolor;
|
|
104
77
|
|
|
105
78
|
/**
|
|
106
79
|
* object type
|
|
107
|
-
* @public
|
|
108
80
|
* @type {string}
|
|
109
81
|
* @deprecated since Tiled 1.9
|
|
110
82
|
* @see https://docs.mapeditor.org/en/stable/reference/tmx-changelog/#tiled-1-9
|
|
111
|
-
* @name type
|
|
112
|
-
* @memberof TMXObject
|
|
113
83
|
*/
|
|
114
84
|
this.type = settings.type;
|
|
115
85
|
|
|
116
86
|
/**
|
|
117
87
|
* the object class
|
|
118
|
-
* @public
|
|
119
88
|
* @type {string}
|
|
120
|
-
* @name class
|
|
121
|
-
* @memberof TMXObject
|
|
122
89
|
*/
|
|
123
90
|
this.class = typeof settings.class !== "undefined" ? settings.class : settings.type;
|
|
124
91
|
|
|
125
92
|
/**
|
|
126
93
|
* object text
|
|
127
|
-
* @public
|
|
128
94
|
* @type {object}
|
|
129
95
|
* @see http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#text
|
|
130
|
-
* @name text
|
|
131
|
-
* @memberof TMXObject
|
|
132
96
|
*/
|
|
133
97
|
this.text = undefined;
|
|
134
98
|
|
|
135
99
|
/**
|
|
136
100
|
* The rotation of the object in radians clockwise (defaults to 0)
|
|
137
|
-
* @public
|
|
138
101
|
* @type {number}
|
|
139
|
-
* @name rotation
|
|
140
|
-
* @memberof TMXObject
|
|
141
102
|
*/
|
|
142
103
|
this.rotation = degToRad(+settings.rotation || 0);
|
|
143
104
|
|
|
144
105
|
/**
|
|
145
106
|
* object unique identifier per level (Tiled 0.11.x+)
|
|
146
|
-
* @public
|
|
147
107
|
* @type {number}
|
|
148
|
-
* @name id
|
|
149
|
-
* @memberof TMXObject
|
|
150
108
|
*/
|
|
151
109
|
this.id = +settings.id || undefined;
|
|
152
110
|
|
|
153
111
|
/**
|
|
154
112
|
* object orientation (orthogonal or isometric)
|
|
155
|
-
* @public
|
|
156
113
|
* @type {string}
|
|
157
|
-
* @name orientation
|
|
158
|
-
* @memberof TMXObject
|
|
159
114
|
*/
|
|
160
115
|
this.orientation = map.orientation;
|
|
161
116
|
|
|
162
117
|
/**
|
|
163
118
|
* the collision shapes defined for this object
|
|
164
|
-
* @public
|
|
165
119
|
* @type {object[]}
|
|
166
|
-
* @name shapes
|
|
167
|
-
* @memberof TMXObject
|
|
168
120
|
*/
|
|
169
121
|
this.shapes = undefined;
|
|
170
122
|
|
|
171
123
|
/**
|
|
172
124
|
* if true, the object is an Ellipse
|
|
173
|
-
* @public
|
|
174
125
|
* @type {boolean}
|
|
175
|
-
* @name isEllipse
|
|
176
|
-
* @memberof TMXObject
|
|
177
126
|
*/
|
|
178
127
|
this.isEllipse = false;
|
|
179
128
|
|
|
180
129
|
/**
|
|
181
130
|
* if true, the object is a Point
|
|
182
|
-
* @public
|
|
183
131
|
* @type {boolean}
|
|
184
|
-
* @name isPoint
|
|
185
|
-
* @memberof TMXObject
|
|
186
132
|
*/
|
|
187
133
|
this.isPoint = false;
|
|
188
134
|
|
|
189
135
|
/**
|
|
190
136
|
* if true, the object is a Polygon
|
|
191
|
-
* @public
|
|
192
137
|
* @type {boolean}
|
|
193
|
-
* @name isPolygon
|
|
194
|
-
* @memberof TMXObject
|
|
195
138
|
*/
|
|
196
139
|
this.isPolygon = false;
|
|
197
140
|
|
|
198
141
|
/**
|
|
199
142
|
* if true, the object is a PolyLine
|
|
200
|
-
* @public
|
|
201
143
|
* @type {boolean}
|
|
202
|
-
* @name isPolyLine
|
|
203
|
-
* @memberof TMXObject
|
|
204
144
|
*/
|
|
205
145
|
this.isPolyLine = false;
|
|
206
146
|
|
|
@@ -272,8 +212,6 @@ class TMXObject {
|
|
|
272
212
|
|
|
273
213
|
/**
|
|
274
214
|
* parses the TMX shape definition and returns a corresponding array of me.Shape object
|
|
275
|
-
* @name parseTMXShapes
|
|
276
|
-
* @memberof TMXObject
|
|
277
215
|
* @private
|
|
278
216
|
* @returns {Polygon[]|Line[]|Ellipse[]} an array of shape objects
|
|
279
217
|
*/
|
|
@@ -1,19 +1,14 @@
|
|
|
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 Matrix2d from '../../math/matrix2.js';
|
|
9
9
|
import Sprite from '../../renderable/sprite.js';
|
|
10
10
|
import Bounds from '../../physics/bounds.js';
|
|
11
|
-
|
|
12
|
-
// bitmask constants to check for flipped & rotated tiles
|
|
13
|
-
const TMX_FLIP_H = 0x80000000,
|
|
14
|
-
TMX_FLIP_V = 0x40000000,
|
|
15
|
-
TMX_FLIP_AD = 0x20000000,
|
|
16
|
-
TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
11
|
+
import { TMX_CLEAR_BIT_MASK, TMX_FLIP_H, TMX_FLIP_V, TMX_FLIP_AD } from './constants.js';
|
|
17
12
|
|
|
18
13
|
/**
|
|
19
14
|
* @classdesc
|
|
@@ -47,9 +42,7 @@ const TMX_FLIP_H = 0x80000000,
|
|
|
47
42
|
|
|
48
43
|
/**
|
|
49
44
|
* tileset
|
|
50
|
-
* @public
|
|
51
45
|
* @type {TMXTileset}
|
|
52
|
-
* @name Tile#tileset
|
|
53
46
|
*/
|
|
54
47
|
this.tileset = tileset;
|
|
55
48
|
|
|
@@ -65,38 +58,31 @@ const TMX_FLIP_H = 0x80000000,
|
|
|
65
58
|
|
|
66
59
|
/**
|
|
67
60
|
* tileId
|
|
68
|
-
* @public
|
|
69
61
|
* @type {number}
|
|
70
|
-
* @name Tile#tileId
|
|
71
62
|
*/
|
|
72
63
|
this.tileId = gid;
|
|
64
|
+
|
|
73
65
|
/**
|
|
74
|
-
* True if the tile is flipped horizontally
|
|
75
|
-
* @public
|
|
66
|
+
* True if the tile is flipped horizontally
|
|
76
67
|
* @type {boolean}
|
|
77
|
-
* @name Tile#flipX
|
|
78
68
|
*/
|
|
79
69
|
this.flippedX = (this.tileId & TMX_FLIP_H) !== 0;
|
|
70
|
+
|
|
80
71
|
/**
|
|
81
|
-
* True if the tile is flipped vertically
|
|
82
|
-
* @public
|
|
72
|
+
* True if the tile is flipped vertically
|
|
83
73
|
* @type {boolean}
|
|
84
|
-
* @name Tile#flippedY
|
|
85
74
|
*/
|
|
86
75
|
this.flippedY = (this.tileId & TMX_FLIP_V) !== 0;
|
|
76
|
+
|
|
87
77
|
/**
|
|
88
|
-
* True if the tile is flipped anti-diagonally
|
|
89
|
-
* @public
|
|
78
|
+
* True if the tile is flipped anti-diagonally
|
|
90
79
|
* @type {boolean}
|
|
91
|
-
* @name Tile#flippedAD
|
|
92
80
|
*/
|
|
93
81
|
this.flippedAD = (this.tileId & TMX_FLIP_AD) !== 0;
|
|
94
82
|
|
|
95
83
|
/**
|
|
96
|
-
* Global flag that indicates if the tile is flipped
|
|
97
|
-
* @public
|
|
84
|
+
* Global flag that indicates if the tile is flipped
|
|
98
85
|
* @type {boolean}
|
|
99
|
-
* @name Tile#flipped
|
|
100
86
|
*/
|
|
101
87
|
this.flipped = this.flippedX || this.flippedY || this.flippedAD;
|
|
102
88
|
|
|
@@ -137,8 +123,6 @@ const TMX_FLIP_H = 0x80000000,
|
|
|
137
123
|
|
|
138
124
|
/**
|
|
139
125
|
* return a renderable object for this Tile object
|
|
140
|
-
* @name Tile#getRenderable
|
|
141
|
-
* @public
|
|
142
126
|
* @param {object} [settings] - see {@link Sprite}
|
|
143
127
|
* @returns {Renderable} a me.Sprite object
|
|
144
128
|
*/
|
|
@@ -1,53 +1,25 @@
|
|
|
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 pool from '../../system/pooling.js';
|
|
9
9
|
import { off, on, VIEWPORT_ONRESIZE } from '../../system/event.js';
|
|
10
|
-
import game from '../../
|
|
10
|
+
import { game } from '../../index.js';
|
|
11
|
+
import utils from '../../utils/utils.js';
|
|
11
12
|
import collision from '../../physics/collision.js';
|
|
12
13
|
import Body from '../../physics/body.js';
|
|
13
|
-
import TMXOrthogonalRenderer from './renderer/TMXOrthogonalRenderer.js';
|
|
14
|
-
import TMXIsometricRenderer from './renderer/TMXIsometricRenderer.js';
|
|
15
|
-
import TMXHexagonalRenderer from './renderer/TMXHexagonalRenderer.js';
|
|
16
|
-
import TMXStaggeredRenderer from './renderer/TMXStaggeredRenderer.js';
|
|
17
14
|
import TMXTileset from './TMXTileset.js';
|
|
18
15
|
import TMXTilesetGroup from './TMXTilesetGroup.js';
|
|
19
16
|
import TMXGroup from './TMXGroup.js';
|
|
20
17
|
import TMXLayer from './TMXLayer.js';
|
|
21
18
|
import { applyTMXProperties } from './TMXUtils.js';
|
|
22
19
|
import Container from '../../renderable/container.js';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* set a compatible renderer object
|
|
29
|
-
* for the specified map
|
|
30
|
-
* @ignore
|
|
31
|
-
*/
|
|
32
|
-
function getNewDefaultRenderer(map) {
|
|
33
|
-
switch (map.orientation) {
|
|
34
|
-
case "orthogonal":
|
|
35
|
-
return new TMXOrthogonalRenderer(map);
|
|
36
|
-
|
|
37
|
-
case "isometric":
|
|
38
|
-
return new TMXIsometricRenderer(map);
|
|
39
|
-
|
|
40
|
-
case "hexagonal":
|
|
41
|
-
return new TMXHexagonalRenderer(map);
|
|
42
|
-
|
|
43
|
-
case "staggered":
|
|
44
|
-
return new TMXStaggeredRenderer(map);
|
|
45
|
-
|
|
46
|
-
// if none found, throw an exception
|
|
47
|
-
default:
|
|
48
|
-
throw new Error(map.orientation + " type TMX Tile Map not supported!");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
20
|
+
import { COLLISION_GROUP } from './constants.js';
|
|
21
|
+
import { getNewTMXRenderer } from './renderer/autodetect.js';
|
|
22
|
+
import { warning } from '../../lang/console.js';
|
|
51
23
|
|
|
52
24
|
/**
|
|
53
25
|
* read the layer Data
|
|
@@ -129,96 +101,73 @@ function readObjectGroup(map, data, z) {
|
|
|
129
101
|
|
|
130
102
|
/**
|
|
131
103
|
* name of the tilemap
|
|
132
|
-
* @public
|
|
133
104
|
* @type {string}
|
|
134
|
-
* @name TMXTileMap#name
|
|
135
105
|
*/
|
|
136
106
|
this.name = levelId;
|
|
137
107
|
|
|
138
108
|
/**
|
|
139
109
|
* width of the tilemap in tiles
|
|
140
|
-
* @public
|
|
141
110
|
* @type {number}
|
|
142
|
-
* @name TMXTileMap#cols
|
|
143
111
|
*/
|
|
144
112
|
this.cols = +data.width;
|
|
113
|
+
|
|
145
114
|
/**
|
|
146
115
|
* height of the tilemap in tiles
|
|
147
|
-
* @public
|
|
148
116
|
* @type {number}
|
|
149
|
-
* @name TMXTileMap#rows
|
|
150
117
|
*/
|
|
151
118
|
this.rows = +data.height;
|
|
152
119
|
|
|
153
120
|
/**
|
|
154
121
|
* Tile width
|
|
155
|
-
* @public
|
|
156
122
|
* @type {number}
|
|
157
|
-
* @name TMXTileMap#tilewidth
|
|
158
123
|
*/
|
|
159
124
|
this.tilewidth = +data.tilewidth;
|
|
160
125
|
|
|
161
126
|
/**
|
|
162
127
|
* Tile height
|
|
163
|
-
* @public
|
|
164
128
|
* @type {number}
|
|
165
|
-
* @name TMXTileMap#tileheight
|
|
166
129
|
*/
|
|
167
130
|
this.tileheight = +data.tileheight;
|
|
168
131
|
|
|
169
132
|
/**
|
|
170
133
|
* is the map an infinite map
|
|
171
|
-
* @public
|
|
172
134
|
* @type {number}
|
|
173
135
|
* @default 0
|
|
174
|
-
* @name TMXTileMap#infinite
|
|
175
136
|
*/
|
|
176
|
-
this.infinite = +data.infinite;
|
|
137
|
+
this.infinite = +data.infinite || 0;
|
|
177
138
|
|
|
178
139
|
/**
|
|
179
140
|
* the map orientation type. melonJS supports “orthogonal”, “isometric”, “staggered” and “hexagonal”.
|
|
180
|
-
* @public
|
|
181
141
|
* @type {string}
|
|
182
142
|
* @default "orthogonal"
|
|
183
|
-
* @name TMXTileMap#orientation
|
|
184
143
|
*/
|
|
185
144
|
this.orientation = data.orientation;
|
|
186
145
|
|
|
187
146
|
/**
|
|
188
147
|
* the order in which tiles on orthogonal tile layers are rendered.
|
|
189
148
|
* (valid values are "left-down", "left-up", "right-down", "right-up")
|
|
190
|
-
* @public
|
|
191
149
|
* @type {string}
|
|
192
150
|
* @default "right-down"
|
|
193
|
-
* @name TMXTileMap#renderorder
|
|
194
151
|
*/
|
|
195
152
|
this.renderorder = data.renderorder || "right-down";
|
|
196
153
|
|
|
197
154
|
/**
|
|
198
155
|
* the TMX format version
|
|
199
|
-
* @public
|
|
200
156
|
* @type {string}
|
|
201
|
-
* @name TMXTileMap#version
|
|
202
157
|
*/
|
|
203
|
-
this.version = data.version;
|
|
158
|
+
this.version = "" + data.version;
|
|
204
159
|
|
|
205
160
|
/**
|
|
206
161
|
* The Tiled version used to save the file (since Tiled 1.0.1).
|
|
207
|
-
* @public
|
|
208
162
|
* @type {string}
|
|
209
|
-
* @name TMXTileMap#tiledversion
|
|
210
163
|
*/
|
|
211
|
-
this.tiledversion = data.tiledversion;
|
|
212
|
-
|
|
164
|
+
this.tiledversion = "" + data.tiledversion;
|
|
213
165
|
|
|
214
166
|
/**
|
|
215
167
|
* The map class.
|
|
216
|
-
* @public
|
|
217
168
|
* @type {string}
|
|
218
|
-
* @name TMXTileMap#class
|
|
219
169
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
170
|
+
this.class = data.class;
|
|
222
171
|
|
|
223
172
|
// tilesets for this map
|
|
224
173
|
this.tilesets = null;
|
|
@@ -235,7 +184,6 @@ function readObjectGroup(map, data, z) {
|
|
|
235
184
|
// Check if map is from melon editor
|
|
236
185
|
this.isEditor = data.editor === "melon-editor";
|
|
237
186
|
|
|
238
|
-
|
|
239
187
|
// object id
|
|
240
188
|
this.nextobjectid = +data.nextobjectid || undefined;
|
|
241
189
|
|
|
@@ -254,37 +202,31 @@ function readObjectGroup(map, data, z) {
|
|
|
254
202
|
// background color
|
|
255
203
|
this.backgroundcolor = data.backgroundcolor;
|
|
256
204
|
|
|
205
|
+
// deprecation warning if map tiled version is older than 1.5
|
|
206
|
+
if (utils.checkVersion(this.version, "1.5") < 0) {
|
|
207
|
+
warning("("+this.name+") Tiled Map format version 1.4 and below", "Tiled 1.5 or higher", "10.4.4");
|
|
208
|
+
}
|
|
209
|
+
|
|
257
210
|
// set additional map properties (if any)
|
|
258
211
|
applyTMXProperties(this, data);
|
|
259
212
|
|
|
260
213
|
// internal flag
|
|
261
214
|
this.initialized = false;
|
|
262
|
-
|
|
263
|
-
if (this.infinite === 1) {
|
|
264
|
-
// #956 Support for Infinite map
|
|
265
|
-
// see as well in me.TMXUtils
|
|
266
|
-
throw new Error("Tiled Infinite Map not supported!");
|
|
267
|
-
}
|
|
268
215
|
}
|
|
269
216
|
|
|
270
217
|
/**
|
|
271
218
|
* Return the map default renderer
|
|
272
|
-
* @name getRenderer
|
|
273
|
-
* @memberof TMXTileMap
|
|
274
|
-
* @public
|
|
275
219
|
* @returns {TMXRenderer} a TMX renderer
|
|
276
220
|
*/
|
|
277
221
|
getRenderer() {
|
|
278
222
|
if ((typeof(this.renderer) === "undefined") || (!this.renderer.canRender(this))) {
|
|
279
|
-
this.renderer =
|
|
223
|
+
this.renderer = getNewTMXRenderer(this);
|
|
280
224
|
}
|
|
281
225
|
return this.renderer;
|
|
282
226
|
}
|
|
283
227
|
|
|
284
228
|
/**
|
|
285
229
|
* return the map bounding rect
|
|
286
|
-
* @name TMXRenderer#getBounds
|
|
287
|
-
* @public
|
|
288
230
|
* @returns {Bounds}
|
|
289
231
|
*/
|
|
290
232
|
getBounds() {
|
|
@@ -362,8 +304,6 @@ function readObjectGroup(map, data, z) {
|
|
|
362
304
|
/**
|
|
363
305
|
* add all the map layers and objects to the given container.
|
|
364
306
|
* note : this will not automatically update the camera viewport
|
|
365
|
-
* @name TMXTileMap#addTo
|
|
366
|
-
* @public
|
|
367
307
|
* @param {Container} container - target container
|
|
368
308
|
* @param {boolean} [flatten=true] - if true, flatten all objects into the given container, else a `me.Container` object will be created for each corresponding groups
|
|
369
309
|
* @param {boolean} [setViewportBounds=false] - if true, set the viewport bounds to the map size, this should be set to true especially if adding a level to the game world container.
|
|
@@ -438,8 +378,6 @@ function readObjectGroup(map, data, z) {
|
|
|
438
378
|
|
|
439
379
|
/**
|
|
440
380
|
* return an Array of instantiated objects, based on the map object definition
|
|
441
|
-
* @name TMXTileMap#getObjects
|
|
442
|
-
* @public
|
|
443
381
|
* @param {boolean} [flatten=true] - if true, flatten all objects into the returned array.
|
|
444
382
|
* when false, a `me.Container` object will be created for each corresponding groups
|
|
445
383
|
* @returns {Renderable[]} Array of Objects
|
|
@@ -610,8 +548,6 @@ function readObjectGroup(map, data, z) {
|
|
|
610
548
|
|
|
611
549
|
/**
|
|
612
550
|
* return all the existing layers
|
|
613
|
-
* @name TMXTileMap#getLayers
|
|
614
|
-
* @public
|
|
615
551
|
* @returns {TMXLayer[]} Array of Layers
|
|
616
552
|
*/
|
|
617
553
|
getLayers() {
|
|
@@ -622,8 +558,6 @@ function readObjectGroup(map, data, z) {
|
|
|
622
558
|
|
|
623
559
|
/**
|
|
624
560
|
* destroy function, clean all allocated objects
|
|
625
|
-
* @name TMXTileMap#destroy
|
|
626
|
-
* @public
|
|
627
561
|
*/
|
|
628
562
|
destroy() {
|
|
629
563
|
this.tilesets = undefined;
|
|
@@ -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 Vector2d from '../../math/vector2.js';
|
|
9
9
|
import { renderer } from '../../video/video.js';
|
|
@@ -55,25 +55,19 @@ import loader from '../../loader/loader.js';
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Tileset contains animated tiles
|
|
58
|
-
* @public
|
|
59
58
|
* @type {boolean}
|
|
60
|
-
* @name TMXTileset#isAnimated
|
|
61
59
|
*/
|
|
62
60
|
this.isAnimated = false;
|
|
63
61
|
|
|
64
62
|
/**
|
|
65
63
|
* true if the tileset is a "Collection of Image" Tileset
|
|
66
|
-
* @public
|
|
67
64
|
* @type {boolean}
|
|
68
|
-
* @name TMXTileset#isCollection
|
|
69
65
|
*/
|
|
70
66
|
this.isCollection = false;
|
|
71
67
|
|
|
72
68
|
/**
|
|
73
69
|
* the tileset class
|
|
74
|
-
* @public
|
|
75
70
|
* @type {boolean}
|
|
76
|
-
* @name TMXTileset#class
|
|
77
71
|
*/
|
|
78
72
|
this.class = tileset.class;
|
|
79
73
|
|
|
@@ -179,8 +173,6 @@ import loader from '../../loader/loader.js';
|
|
|
179
173
|
|
|
180
174
|
/**
|
|
181
175
|
* return the tile image from a "Collection of Image" tileset
|
|
182
|
-
* @name TMXTileset#getTileImage
|
|
183
|
-
* @public
|
|
184
176
|
* @param {number} gid
|
|
185
177
|
* @returns {Image} corresponding image or undefined
|
|
186
178
|
*/
|
|
@@ -200,8 +192,6 @@ import loader from '../../loader/loader.js';
|
|
|
200
192
|
|
|
201
193
|
/**
|
|
202
194
|
* return true if the gid belongs to the tileset
|
|
203
|
-
* @name TMXTileset#contains
|
|
204
|
-
* @public
|
|
205
195
|
* @param {number} gid
|
|
206
196
|
* @returns {boolean}
|
|
207
197
|
*/
|
|
@@ -211,8 +201,6 @@ import loader from '../../loader/loader.js';
|
|
|
211
201
|
|
|
212
202
|
/**
|
|
213
203
|
* Get the view (local) tile ID from a GID, with animations applied
|
|
214
|
-
* @name TMXTileset#getViewTileId
|
|
215
|
-
* @public
|
|
216
204
|
* @param {number} gid - Global tile ID
|
|
217
205
|
* @returns {number} View tile ID
|
|
218
206
|
*/
|
|
@@ -229,8 +217,6 @@ import loader from '../../loader/loader.js';
|
|
|
229
217
|
|
|
230
218
|
/**
|
|
231
219
|
* return the properties of the specified tile
|
|
232
|
-
* @name TMXTileset#getTileProperties
|
|
233
|
-
* @public
|
|
234
220
|
* @param {number} tileId
|
|
235
221
|
* @returns {object}
|
|
236
222
|
*/
|
|
@@ -1,12 +1,11 @@
|
|
|
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
|
-
|
|
9
|
-
const TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
8
|
+
import { TMX_CLEAR_BIT_MASK } from './constants.js';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @classdesc
|
|
@@ -21,8 +20,6 @@ const TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* add a tileset to the tileset group
|
|
24
|
-
* @name TMXTilesetGroup#add
|
|
25
|
-
* @public
|
|
26
23
|
* @param {TMXTileset} tileset
|
|
27
24
|
*/
|
|
28
25
|
add(tileset) {
|
|
@@ -32,8 +29,6 @@ const TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
|
32
29
|
|
|
33
30
|
/**
|
|
34
31
|
* return the tileset at the specified index
|
|
35
|
-
* @name TMXTilesetGroup#getTilesetByIndex
|
|
36
|
-
* @public
|
|
37
32
|
* @param {number} i
|
|
38
33
|
* @returns {TMXTileset} corresponding tileset
|
|
39
34
|
*/
|
|
@@ -44,8 +39,6 @@ const TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
|
44
39
|
/**
|
|
45
40
|
* return the tileset corresponding to the specified id <br>
|
|
46
41
|
* will throw an exception if no matching tileset is found
|
|
47
|
-
* @name TMXTilesetGroup#getTilesetByGid
|
|
48
|
-
* @public
|
|
49
42
|
* @param {number} gid
|
|
50
43
|
* @returns {TMXTileset} corresponding tileset
|
|
51
44
|
*/
|