melonjs 14.1.0 → 14.1.1
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 +1 -1
- package/dist/melonjs.mjs/_virtual/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/_virtual/index2.js +1 -1
- package/dist/melonjs.mjs/_virtual/multimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/setmultimap.js +1 -1
- package/dist/melonjs.mjs/application/application.js +3 -5
- package/dist/melonjs.mjs/audio/audio.js +1 -1
- package/dist/melonjs.mjs/camera/camera2d.js +3 -4
- package/dist/melonjs.mjs/entity/entity.js +3 -4
- package/dist/melonjs.mjs/game.js +1 -1
- package/dist/melonjs.mjs/geometries/ellipse.js +3 -4
- package/dist/melonjs.mjs/geometries/line.js +3 -4
- package/dist/melonjs.mjs/geometries/path2d.js +3 -4
- package/dist/melonjs.mjs/geometries/point.js +3 -4
- package/dist/melonjs.mjs/geometries/poly.js +3 -5
- package/dist/melonjs.mjs/geometries/rectangle.js +3 -4
- package/dist/melonjs.mjs/geometries/roundrect.js +2 -3
- package/dist/melonjs.mjs/index.js +2 -2
- package/dist/melonjs.mjs/input/gamepad.js +1 -1
- package/dist/melonjs.mjs/input/input.js +1 -1
- package/dist/melonjs.mjs/input/keyboard.js +1 -1
- package/dist/melonjs.mjs/input/pointer.js +1 -1
- package/dist/melonjs.mjs/input/pointerevent.js +1 -1
- package/dist/melonjs.mjs/lang/deprecated.js +1 -1
- package/dist/melonjs.mjs/level/level.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +3 -5
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +3 -4
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +5 -8
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +3 -5
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +3 -5
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +3 -5
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +3 -5
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +3 -5
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +3 -4
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +3 -5
- package/dist/melonjs.mjs/loader/loader.js +1 -1
- package/dist/melonjs.mjs/loader/loadingscreen.js +1 -1
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
- package/dist/melonjs.mjs/math/color.js +3 -5
- package/dist/melonjs.mjs/math/math.js +1 -1
- package/dist/melonjs.mjs/math/matrix2.js +3 -5
- package/dist/melonjs.mjs/math/matrix3.js +3 -5
- package/dist/melonjs.mjs/math/observable_vector2.js +3 -5
- package/dist/melonjs.mjs/math/observable_vector3.js +3 -5
- package/dist/melonjs.mjs/math/vector2.js +3 -5
- package/dist/melonjs.mjs/math/vector3.js +3 -5
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
- package/dist/melonjs.mjs/particles/emitter.js +3 -5
- package/dist/melonjs.mjs/particles/particle.js +3 -5
- package/dist/melonjs.mjs/particles/settings.js +1 -1
- package/dist/melonjs.mjs/physics/body.js +3 -5
- package/dist/melonjs.mjs/physics/bounds.js +3 -4
- package/dist/melonjs.mjs/physics/collision.js +1 -1
- package/dist/melonjs.mjs/physics/detector.js +1 -1
- package/dist/melonjs.mjs/physics/quadtree.js +23 -20
- package/dist/melonjs.mjs/physics/response.js +1 -1
- package/dist/melonjs.mjs/physics/sat.js +1 -1
- package/dist/melonjs.mjs/physics/world.js +3 -5
- package/dist/melonjs.mjs/plugin/plugin.js +3 -3
- package/dist/melonjs.mjs/renderable/collectable.js +3 -5
- package/dist/melonjs.mjs/renderable/colorlayer.js +3 -5
- package/dist/melonjs.mjs/renderable/container.js +6 -8
- package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
- package/dist/melonjs.mjs/renderable/imagelayer.js +4 -5
- package/dist/melonjs.mjs/renderable/light2d.js +3 -4
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +3 -4
- package/dist/melonjs.mjs/renderable/renderable.js +5 -7
- package/dist/melonjs.mjs/renderable/sprite.js +3 -4
- package/dist/melonjs.mjs/renderable/trigger.js +3 -4
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +3 -4
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +3 -4
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +3 -4
- package/dist/melonjs.mjs/state/stage.js +3 -4
- package/dist/melonjs.mjs/state/state.js +1 -1
- package/dist/melonjs.mjs/system/device.js +1 -1
- package/dist/melonjs.mjs/system/dom.js +1 -1
- package/dist/melonjs.mjs/system/event.js +1 -1
- package/dist/melonjs.mjs/system/platform.js +1 -1
- package/dist/melonjs.mjs/system/pooling.js +1 -1
- package/dist/melonjs.mjs/system/save.js +1 -1
- package/dist/melonjs.mjs/system/timer.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptext.js +3 -4
- package/dist/melonjs.mjs/text/bitmaptextdata.js +3 -4
- package/dist/melonjs.mjs/text/glyph.js +3 -4
- package/dist/melonjs.mjs/text/text.js +3 -4
- package/dist/melonjs.mjs/text/textmetrics.js +3 -4
- package/dist/melonjs.mjs/text/textstyle.js +1 -1
- package/dist/melonjs.mjs/tweens/easing.js +1 -1
- package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
- package/dist/melonjs.mjs/tweens/tween.js +3 -4
- package/dist/melonjs.mjs/utils/agent.js +1 -1
- package/dist/melonjs.mjs/utils/array.js +1 -1
- package/dist/melonjs.mjs/utils/file.js +1 -1
- package/dist/melonjs.mjs/utils/function.js +1 -1
- package/dist/melonjs.mjs/utils/string.js +1 -1
- package/dist/melonjs.mjs/utils/utils.js +1 -1
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +3 -4
- package/dist/melonjs.mjs/video/renderer.js +4 -5
- package/dist/melonjs.mjs/video/texture/atlas.js +1 -1
- package/dist/melonjs.mjs/video/texture/cache.js +1 -1
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +1 -1
- package/dist/melonjs.mjs/video/video.js +1 -1
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +3 -4
- package/dist/melonjs.mjs/video/webgl/glshader.js +3 -4
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +3 -4
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +3 -4
- package/dist/melonjs.module.d.ts +138 -199
- package/dist/melonjs.module.js +659 -736
- package/package.json +6 -6
- package/src/application/application.js +1 -2
- package/src/camera/camera2d.js +1 -2
- package/src/entity/entity.js +1 -2
- package/src/geometries/ellipse.js +1 -2
- package/src/geometries/line.js +1 -2
- package/src/geometries/path2d.js +1 -2
- package/src/geometries/point.js +1 -2
- package/src/geometries/poly.js +1 -3
- package/src/geometries/rectangle.js +1 -2
- package/src/geometries/roundrect.js +1 -2
- package/src/level/tiled/TMXLayer.js +1 -2
- package/src/level/tiled/TMXTile.js +1 -2
- package/src/level/tiled/TMXTileMap.js +2 -4
- package/src/level/tiled/TMXTileset.js +1 -2
- package/src/level/tiled/TMXTilesetGroup.js +1 -2
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -2
- package/src/math/color.js +1 -2
- package/src/math/matrix2.js +1 -2
- package/src/math/matrix3.js +1 -2
- package/src/math/observable_vector2.js +1 -2
- package/src/math/observable_vector3.js +1 -2
- package/src/math/vector2.js +1 -2
- package/src/math/vector3.js +1 -2
- package/src/particles/emitter.js +1 -2
- package/src/particles/particle.js +1 -2
- package/src/physics/body.js +1 -2
- package/src/physics/bounds.js +2 -2
- package/src/physics/quadtree.js +7 -12
- package/src/physics/world.js +1 -2
- package/src/renderable/collectable.js +1 -3
- package/src/renderable/colorlayer.js +1 -3
- package/src/renderable/container.js +4 -6
- package/src/renderable/imagelayer.js +1 -2
- package/src/renderable/light2d.js +1 -2
- package/src/renderable/nineslicesprite.js +1 -2
- package/src/renderable/renderable.js +3 -5
- package/src/renderable/sprite.js +1 -2
- package/src/renderable/trigger.js +1 -2
- package/src/renderable/ui/uibaseelement.js +1 -2
- package/src/renderable/ui/uispriteelement.js +2 -2
- package/src/renderable/ui/uitextbutton.js +2 -2
- package/src/state/stage.js +1 -2
- package/src/text/bitmaptext.js +1 -2
- package/src/text/bitmaptextdata.js +1 -2
- package/src/text/glyph.js +1 -2
- package/src/text/text.js +1 -2
- package/src/text/textmetrics.js +1 -2
- package/src/tweens/tween.js +1 -2
- package/src/video/canvas/canvas_renderer.js +1 -2
- package/src/video/renderer.js +1 -2
- package/src/video/webgl/buffer/vertex.js +1 -2
- package/src/video/webgl/glshader.js +2 -2
- package/src/video/webgl/webgl_compositor.js +1 -2
- package/src/video/webgl/webgl_renderer.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "melonjs",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.1",
|
|
4
4
|
"description": "melonJS Game Engine",
|
|
5
5
|
"homepage": "http://www.melonjs.org/",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"node": ">= 19"
|
|
39
39
|
},
|
|
40
40
|
"main": "dist/melonjs.module.js",
|
|
41
|
-
"module": "dist/melonjs.
|
|
41
|
+
"module": "dist/melonjs.module.js",
|
|
42
42
|
"types": "dist/melonjs.module.d.ts",
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"files": [
|
|
@@ -69,18 +69,18 @@
|
|
|
69
69
|
"@rollup/plugin-replace": "^5.0.1",
|
|
70
70
|
"@types/offscreencanvas": "^2019.7.0",
|
|
71
71
|
"@webdoc/cli": "^2.2.0",
|
|
72
|
-
"chromedriver": "^107.0.
|
|
72
|
+
"chromedriver": "^107.0.3",
|
|
73
73
|
"cross-env": "^7.0.3",
|
|
74
74
|
"del-cli": "^5.0.0",
|
|
75
75
|
"eslint": "^8.26.0",
|
|
76
|
-
"eslint-plugin-jsdoc": "^39.
|
|
76
|
+
"eslint-plugin-jsdoc": "^39.6.2",
|
|
77
77
|
"expect": "^29.2.2",
|
|
78
78
|
"expect-mocha-image-snapshot": "^2.0.14",
|
|
79
79
|
"fastify": "^4.9.1",
|
|
80
80
|
"mocha": "^10.1.0",
|
|
81
81
|
"npm-self-link": "^1.1.7",
|
|
82
|
-
"puppeteer": "^19.2.
|
|
83
|
-
"rollup": "^3.2.
|
|
82
|
+
"puppeteer": "^19.2.1",
|
|
83
|
+
"rollup": "^3.2.5",
|
|
84
84
|
"rollup-plugin-bundle-size": "^1.0.3",
|
|
85
85
|
"rollup-plugin-string": "^3.0.0",
|
|
86
86
|
"terser": "^5.15.1",
|
|
@@ -10,7 +10,7 @@ import World from "./../physics/world.js";
|
|
|
10
10
|
* An Application is responsible for updating (each frame) all the related object status and draw them.
|
|
11
11
|
* @see game
|
|
12
12
|
*/
|
|
13
|
-
class Application {
|
|
13
|
+
export default class Application {
|
|
14
14
|
constructor() {
|
|
15
15
|
/**
|
|
16
16
|
* a reference to the current active stage "default" camera
|
|
@@ -228,4 +228,3 @@ class Application {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
export default Application;
|
package/src/camera/camera2d.js
CHANGED
|
@@ -23,7 +23,7 @@ var targetV = new Vector2d();
|
|
|
23
23
|
* a 2D orthographic camera
|
|
24
24
|
* @augments Renderable
|
|
25
25
|
*/
|
|
26
|
-
class Camera2d extends Renderable {
|
|
26
|
+
export default class Camera2d extends Renderable {
|
|
27
27
|
/**
|
|
28
28
|
* @param {number} minX - start x offset
|
|
29
29
|
* @param {number} minY - start y offset
|
|
@@ -724,4 +724,3 @@ class Camera2d extends Renderable {
|
|
|
724
724
|
}
|
|
725
725
|
|
|
726
726
|
}
|
|
727
|
-
export default Camera2d;
|
package/src/entity/entity.js
CHANGED
|
@@ -10,7 +10,7 @@ import Body from "./../physics/body.js";
|
|
|
10
10
|
* @augments Renderable
|
|
11
11
|
* @see Renderable
|
|
12
12
|
*/
|
|
13
|
-
class Entity extends Renderable {
|
|
13
|
+
export default class Entity extends Renderable {
|
|
14
14
|
/**
|
|
15
15
|
* @param {number} x - the x coordinates of the entity object
|
|
16
16
|
* @param {number} y - the y coordinates of the entity object
|
|
@@ -237,4 +237,3 @@ class Entity extends Renderable {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
}
|
|
240
|
-
export default Entity;
|
|
@@ -4,7 +4,7 @@ import pool from "./../system/pooling.js";
|
|
|
4
4
|
* @classdesc
|
|
5
5
|
* an ellipse Object
|
|
6
6
|
*/
|
|
7
|
-
class Ellipse {
|
|
7
|
+
export default class Ellipse {
|
|
8
8
|
/**
|
|
9
9
|
* @param {number} x - the center x coordinate of the ellipse
|
|
10
10
|
* @param {number} y - the center y coordinate of the ellipse
|
|
@@ -263,4 +263,3 @@ class Ellipse {
|
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
export default Ellipse;
|
package/src/geometries/line.js
CHANGED
|
@@ -10,7 +10,7 @@ import Polygon from "./poly.js";
|
|
|
10
10
|
* @param {Vector2d[]} points - array of vectors defining the Line
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
class Line extends Polygon {
|
|
13
|
+
export default class Line extends Polygon {
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Returns true if the Line contains the given point
|
|
@@ -104,4 +104,3 @@ class Line extends Polygon {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
}
|
|
107
|
-
export default Line;
|
package/src/geometries/path2d.js
CHANGED
|
@@ -6,7 +6,7 @@ import earcut from "earcut";
|
|
|
6
6
|
* @classdesc
|
|
7
7
|
* a simplified path2d implementation, supporting only one path
|
|
8
8
|
*/
|
|
9
|
-
class Path2D {
|
|
9
|
+
export default class Path2D {
|
|
10
10
|
constructor() {
|
|
11
11
|
/**
|
|
12
12
|
* the points defining the current path
|
|
@@ -306,4 +306,3 @@ class Path2D {
|
|
|
306
306
|
this.arcTo(x, y, x + radius, y, radius);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
export default Path2D;
|
package/src/geometries/point.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @classdesc
|
|
3
3
|
* represents a point in a 2d space
|
|
4
4
|
*/
|
|
5
|
-
class Point {
|
|
5
|
+
export default class Point {
|
|
6
6
|
constructor(x = 0, y = 0) {
|
|
7
7
|
/**
|
|
8
8
|
* the position of the point on the horizontal axis
|
|
@@ -77,4 +77,3 @@ class Point {
|
|
|
77
77
|
return new Point(this.x, this.y);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
export default Point;
|
package/src/geometries/poly.js
CHANGED
|
@@ -12,7 +12,7 @@ import pool from "./../system/pooling.js";
|
|
|
12
12
|
*
|
|
13
13
|
* A polygon's `winding` is clockwise if its vertices (points) are declared turning to the right. The image above shows COUNTERCLOCKWISE winding.
|
|
14
14
|
*/
|
|
15
|
-
class Polygon {
|
|
15
|
+
export default class Polygon {
|
|
16
16
|
/**
|
|
17
17
|
* @param {number} x - origin point of the Polygon
|
|
18
18
|
* @param {number} y - origin point of the Polygon
|
|
@@ -486,5 +486,3 @@ class Polygon {
|
|
|
486
486
|
return new Polygon(this.pos.x, this.pos.y, copy);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
|
|
490
|
-
export default Polygon;
|
|
@@ -6,7 +6,7 @@ import Polygon from "./poly.js";
|
|
|
6
6
|
* a rectangle Object
|
|
7
7
|
* @augments Polygon
|
|
8
8
|
*/
|
|
9
|
-
class Rect extends Polygon {
|
|
9
|
+
export default class Rect extends Polygon {
|
|
10
10
|
/**
|
|
11
11
|
* @param {number} x - position of the Rectangle
|
|
12
12
|
* @param {number} y - position of the Rectangle
|
|
@@ -363,4 +363,3 @@ class Rect extends Polygon {
|
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
export default Rect;
|
|
@@ -7,7 +7,7 @@ import Rect from "./rectangle.js";
|
|
|
7
7
|
* a rectangle object with rounded corners
|
|
8
8
|
* @augments Rect
|
|
9
9
|
*/
|
|
10
|
-
class RoundRect extends Rect {
|
|
10
|
+
export default class RoundRect extends Rect {
|
|
11
11
|
/**
|
|
12
12
|
* @param {number} x - position of the rounded rectangle
|
|
13
13
|
* @param {number} y - position of the rounded rectangle
|
|
@@ -156,4 +156,3 @@ class RoundRect extends Rect {
|
|
|
156
156
|
return new RoundRect(this.pos.x, this.pos.y, this.width, this.height, this.radius);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
export default RoundRect;
|
|
@@ -68,7 +68,7 @@ function preRenderLayer(layer, renderer) {
|
|
|
68
68
|
* Tiled QT 0.7.x format
|
|
69
69
|
* @augments Renderable
|
|
70
70
|
*/
|
|
71
|
-
class TMXLayer extends Renderable {
|
|
71
|
+
export default class TMXLayer extends Renderable {
|
|
72
72
|
/**
|
|
73
73
|
* @param {object} map - layer data in JSON format ({@link http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#layer})
|
|
74
74
|
* @param {object} data - layer data in JSON format ({@link http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#layer})
|
|
@@ -436,4 +436,3 @@ class TMXLayer extends Renderable {
|
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
|
|
439
|
-
export default TMXLayer;
|
|
@@ -13,7 +13,7 @@ const TMX_FLIP_H = 0x80000000,
|
|
|
13
13
|
* a basic tile object
|
|
14
14
|
* @augments Bounds
|
|
15
15
|
*/
|
|
16
|
-
class Tile extends Bounds {
|
|
16
|
+
export default class Tile extends Bounds {
|
|
17
17
|
/**
|
|
18
18
|
* @param {number} x - x index of the Tile in the map
|
|
19
19
|
* @param {number} y - y index of the Tile in the map
|
|
@@ -182,4 +182,3 @@ class Tile extends Bounds {
|
|
|
182
182
|
return renderable;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
export default Tile;
|
|
@@ -12,7 +12,6 @@ import TMXTilesetGroup from "./TMXTilesetGroup.js";
|
|
|
12
12
|
import TMXGroup from "./TMXGroup.js";
|
|
13
13
|
import TMXLayer from "./TMXLayer.js";
|
|
14
14
|
import { applyTMXProperties } from "./TMXUtils.js";
|
|
15
|
-
import Renderable from "./../../renderable/renderable.js";
|
|
16
15
|
import Container from "./../../renderable/container.js";
|
|
17
16
|
|
|
18
17
|
// constant to identify the collision object layer
|
|
@@ -103,7 +102,7 @@ function readObjectGroup(map, data, z) {
|
|
|
103
102
|
* a TMX Tile Map Object
|
|
104
103
|
* Tiled QT +0.7.x format
|
|
105
104
|
*/
|
|
106
|
-
class TMXTileMap {
|
|
105
|
+
export default class TMXTileMap {
|
|
107
106
|
/**
|
|
108
107
|
* @param {string} levelId - name of TMX map
|
|
109
108
|
* @param {object} data - TMX map in JSON format
|
|
@@ -578,7 +577,7 @@ class TMXTileMap {
|
|
|
578
577
|
if (obj.isRenderable === true) {
|
|
579
578
|
obj.setOpacity(obj.getOpacity() * group.opacity);
|
|
580
579
|
// and to child renderables if any
|
|
581
|
-
if (obj.renderable
|
|
580
|
+
if (typeof obj.renderable !== "undefined" && obj.renderable.isRenderable === true) {
|
|
582
581
|
obj.renderable.setOpacity(obj.renderable.getOpacity() * group.opacity);
|
|
583
582
|
}
|
|
584
583
|
}
|
|
@@ -630,4 +629,3 @@ class TMXTileMap {
|
|
|
630
629
|
}
|
|
631
630
|
}
|
|
632
631
|
|
|
633
|
-
export default TMXTileMap;
|
|
@@ -8,7 +8,7 @@ import loader from "./../../loader/loader.js";
|
|
|
8
8
|
* @classdesc
|
|
9
9
|
* a TMX Tile Set Object
|
|
10
10
|
*/
|
|
11
|
-
class TMXTileset {
|
|
11
|
+
export default class TMXTileset {
|
|
12
12
|
/**
|
|
13
13
|
* @param {object} tileset - tileset data in JSON format ({@link http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#tileset})
|
|
14
14
|
*/
|
|
@@ -299,4 +299,3 @@ class TMXTileset {
|
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
export default TMXTileset;
|
|
@@ -6,7 +6,7 @@ const TMX_CLEAR_BIT_MASK = ~(0x80000000 | 0x40000000 | 0x20000000);
|
|
|
6
6
|
* @classdesc
|
|
7
7
|
* an object containing all tileset
|
|
8
8
|
*/
|
|
9
|
-
class TMXTilesetGroup {
|
|
9
|
+
export default class TMXTilesetGroup {
|
|
10
10
|
|
|
11
11
|
constructor() {
|
|
12
12
|
this.tilesets = [];
|
|
@@ -72,4 +72,3 @@ class TMXTilesetGroup {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export default TMXTilesetGroup;
|
|
@@ -24,7 +24,7 @@ const offsetsStaggerY = [
|
|
|
24
24
|
* an Hexagonal Map Renderder
|
|
25
25
|
* @augments TMXRenderer
|
|
26
26
|
*/
|
|
27
|
-
class TMXHexagonalRenderer extends TMXRenderer {
|
|
27
|
+
export default class TMXHexagonalRenderer extends TMXRenderer {
|
|
28
28
|
/**
|
|
29
29
|
* @param {TMXTileMap} map - the TMX map
|
|
30
30
|
*/
|
|
@@ -496,4 +496,3 @@ class TMXHexagonalRenderer extends TMXRenderer {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
export default TMXHexagonalRenderer;
|
|
@@ -9,7 +9,7 @@ import TMXLayer from "./../TMXLayer.js";
|
|
|
9
9
|
* an Isometric Map Renderder
|
|
10
10
|
* @augments TMXRenderer
|
|
11
11
|
*/
|
|
12
|
-
class TMXIsometricRenderer extends TMXRenderer {
|
|
12
|
+
export default class TMXIsometricRenderer extends TMXRenderer {
|
|
13
13
|
/**
|
|
14
14
|
* @param {TMXTileMap} map - the TMX map
|
|
15
15
|
*/
|
|
@@ -209,4 +209,3 @@ class TMXIsometricRenderer extends TMXRenderer {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
export default TMXIsometricRenderer;
|
|
@@ -7,7 +7,7 @@ import TMXRenderer from "./TMXRenderer.js";
|
|
|
7
7
|
* an Orthogonal Map Renderder
|
|
8
8
|
* @augments TMXRenderer
|
|
9
9
|
*/
|
|
10
|
-
class TMXOrthogonalRenderer extends TMXRenderer {
|
|
10
|
+
export default class TMXOrthogonalRenderer extends TMXRenderer {
|
|
11
11
|
/**
|
|
12
12
|
* @param {TMXTileMap} map - the TMX map
|
|
13
13
|
*/
|
|
@@ -147,4 +147,3 @@ class TMXOrthogonalRenderer extends TMXRenderer {
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
export default TMXOrthogonalRenderer;
|
|
@@ -8,7 +8,7 @@ import Bounds from "./../../../physics/bounds.js";
|
|
|
8
8
|
* @classdesc
|
|
9
9
|
* The map renderer base class
|
|
10
10
|
*/
|
|
11
|
-
class TMXRenderer {
|
|
11
|
+
export default class TMXRenderer {
|
|
12
12
|
/**
|
|
13
13
|
* @param {number} cols - width of the tilemap in tiles
|
|
14
14
|
* @param {number} rows - height of the tilemap in tiles
|
|
@@ -111,6 +111,5 @@ class TMXRenderer {
|
|
|
111
111
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
export default TMXRenderer;
|
|
115
114
|
|
|
116
115
|
/* eslint-enable no-unused-vars */
|
|
@@ -9,7 +9,7 @@ import { degToRad } from "./../../../math/math.js";
|
|
|
9
9
|
* a Staggered Map Renderder
|
|
10
10
|
* @augments TMXHexagonalRenderer
|
|
11
11
|
*/
|
|
12
|
-
class TMXStaggeredRenderer extends TMXHexagonalRenderer {
|
|
12
|
+
export default class TMXStaggeredRenderer extends TMXHexagonalRenderer {
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* return true if the renderer can render the specified layer
|
|
@@ -98,4 +98,3 @@ class TMXStaggeredRenderer extends TMXHexagonalRenderer {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
export default TMXStaggeredRenderer;
|
package/src/math/color.js
CHANGED
|
@@ -182,7 +182,7 @@ var cssToRGB = new Map();
|
|
|
182
182
|
* @classdesc
|
|
183
183
|
* A color manipulation object.
|
|
184
184
|
*/
|
|
185
|
-
class Color {
|
|
185
|
+
export default class Color {
|
|
186
186
|
/**
|
|
187
187
|
* @param {number} [r=0] - red component or array of color components
|
|
188
188
|
* @param {number} [g=0] - green component
|
|
@@ -606,4 +606,3 @@ class Color {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
|
|
609
|
-
export default Color;
|
package/src/math/matrix2.js
CHANGED
|
@@ -7,7 +7,7 @@ import Matrix3d from "./matrix3.js";
|
|
|
7
7
|
* the identity matrix and parameters position : <br>
|
|
8
8
|
* <img src="images/identity-matrix_2x.png"/>
|
|
9
9
|
*/
|
|
10
|
-
class Matrix2d {
|
|
10
|
+
export default class Matrix2d {
|
|
11
11
|
/**
|
|
12
12
|
* @param {(Matrix2d|Matrix3d|...number)} args - an instance of me.Matrix2d or me.Matrix3d to copy from, or individual matrix components (See {@link Matrix2d.setTransform}). If not arguments are given, the matrix will be set to Identity.
|
|
13
13
|
*/
|
|
@@ -491,4 +491,3 @@ class Matrix2d {
|
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
-
export default Matrix2d;
|
package/src/math/matrix3.js
CHANGED
|
@@ -5,7 +5,7 @@ import { EPSILON } from "./math.js";
|
|
|
5
5
|
* @classdesc
|
|
6
6
|
* a 4x4 Matrix3d Object
|
|
7
7
|
*/
|
|
8
|
-
class Matrix3d {
|
|
8
|
+
export default class Matrix3d {
|
|
9
9
|
/**
|
|
10
10
|
* @param {(Matrix3d|...number)} args - An instance of me.Matrix3d to copy from, or individual Matrix components (See {@link Matrix3d.setTransform}). If not arguments are given, the matrix will be set to Identity.
|
|
11
11
|
*/
|
|
@@ -669,4 +669,3 @@ class Matrix3d {
|
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
|
|
672
|
-
export default Matrix3d;
|
|
@@ -7,7 +7,7 @@ import {clamp} from "./math.js";
|
|
|
7
7
|
* A Vector2d object that provide notification by executing the given callback when the vector is changed.
|
|
8
8
|
* @augments Vector2d
|
|
9
9
|
*/
|
|
10
|
-
class ObservableVector2d extends Vector2d {
|
|
10
|
+
export default class ObservableVector2d extends Vector2d {
|
|
11
11
|
/**
|
|
12
12
|
* @param {number} x - x value of the vector
|
|
13
13
|
* @param {number} y - y value of the vector
|
|
@@ -459,4 +459,3 @@ class ObservableVector2d extends Vector2d {
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
export default ObservableVector2d;
|
|
@@ -7,7 +7,7 @@ import pool from "./../system/pooling.js";
|
|
|
7
7
|
* A Vector3d object that provide notification by executing the given callback when the vector is changed.
|
|
8
8
|
* @augments Vector3d
|
|
9
9
|
*/
|
|
10
|
-
class ObservableVector3d extends Vector3d {
|
|
10
|
+
export default class ObservableVector3d extends Vector3d {
|
|
11
11
|
/**
|
|
12
12
|
* @param {number} x - x value of the vector
|
|
13
13
|
* @param {number} y - y value of the vector
|
|
@@ -549,4 +549,3 @@ class ObservableVector3d extends Vector3d {
|
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
export default ObservableVector3d;
|
package/src/math/vector2.js
CHANGED
|
@@ -5,7 +5,7 @@ import pool from "./../system/pooling.js";
|
|
|
5
5
|
* @classdesc
|
|
6
6
|
* a generic 2D Vector Object
|
|
7
7
|
*/
|
|
8
|
-
class Vector2d {
|
|
8
|
+
export default class Vector2d {
|
|
9
9
|
/**
|
|
10
10
|
* @param {number} [x=0] - x value of the vector
|
|
11
11
|
* @param {number} [y=0] - y value of the vector
|
|
@@ -516,4 +516,3 @@ class Vector2d {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
-
export default Vector2d;
|
package/src/math/vector3.js
CHANGED
|
@@ -5,7 +5,7 @@ import pool from "./../system/pooling.js";
|
|
|
5
5
|
* @classdesc
|
|
6
6
|
* a generic 3D Vector Object
|
|
7
7
|
*/
|
|
8
|
-
class Vector3d {
|
|
8
|
+
export default class Vector3d {
|
|
9
9
|
/**
|
|
10
10
|
* @param {number} [x=0] - x value of the vector
|
|
11
11
|
* @param {number} [y=0] - y value of the vector
|
|
@@ -557,4 +557,3 @@ class Vector3d {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
|
|
560
|
-
export default Vector3d;
|
package/src/particles/emitter.js
CHANGED
|
@@ -21,7 +21,7 @@ function createDefaultParticleTexture(w = 8, h = 8) {
|
|
|
21
21
|
* Particle Emitter Object.
|
|
22
22
|
* @augments Container
|
|
23
23
|
*/
|
|
24
|
-
class ParticleEmitter extends Container {
|
|
24
|
+
export default class ParticleEmitter extends Container {
|
|
25
25
|
/**
|
|
26
26
|
* @param {number} x - x position of the particle emitter
|
|
27
27
|
* @param {number} y - y position of the particle emitter
|
|
@@ -256,4 +256,3 @@ class ParticleEmitter extends Container {
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
export default ParticleEmitter;
|
|
@@ -8,7 +8,7 @@ import Renderable from "./../renderable/renderable.js";
|
|
|
8
8
|
* Single Particle Object.
|
|
9
9
|
* @augments Renderable
|
|
10
10
|
*/
|
|
11
|
-
class Particle extends Renderable {
|
|
11
|
+
export default class Particle extends Renderable {
|
|
12
12
|
/**
|
|
13
13
|
* @param {ParticleEmitter} emitter - the particle emitter
|
|
14
14
|
*/
|
|
@@ -176,4 +176,3 @@ class Particle extends Renderable {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
export default Particle;
|
package/src/physics/body.js
CHANGED
|
@@ -14,7 +14,7 @@ import Point from "../geometries/point.js";
|
|
|
14
14
|
* a Generic Physic Body Object with some physic properties and behavior functionality, to as a member of a Renderable.
|
|
15
15
|
* @see Renderable.body
|
|
16
16
|
*/
|
|
17
|
-
class Body {
|
|
17
|
+
export default class Body {
|
|
18
18
|
/**
|
|
19
19
|
* @param {Renderable} ancestor - the parent object this body is attached to
|
|
20
20
|
* @param {Rect|Rect[]|Polygon|Polygon[]|Line|Line[]|Ellipse|Ellipse[]|Point|Point[]|Bounds|Bounds[]|object} [shapes] - a initial shape, list of shapes, or JSON object defining the body
|
|
@@ -692,4 +692,3 @@ class Body {
|
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
export default Body;
|
package/src/physics/bounds.js
CHANGED
|
@@ -5,7 +5,7 @@ import Vector2d from "./../math/vector2.js";
|
|
|
5
5
|
* @classdesc
|
|
6
6
|
* a bound object contains methods for creating and manipulating axis-aligned bounding boxes (AABB).
|
|
7
7
|
*/
|
|
8
|
-
class Bounds {
|
|
8
|
+
export default class Bounds {
|
|
9
9
|
/**
|
|
10
10
|
* @param {Vector2d[]} [vertices] - an array of me.Vector2d points
|
|
11
11
|
*/
|
|
@@ -448,4 +448,4 @@ class Bounds {
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
}
|
|
451
|
-
|
|
451
|
+
|
package/src/physics/quadtree.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Vector2d from "./../math/vector2.js";
|
|
2
|
-
import Container from "./../renderable/container.js";
|
|
3
2
|
import * as arrayUtil from "./../utils/array.js";
|
|
4
3
|
|
|
5
4
|
/*
|
|
@@ -8,7 +7,6 @@ import * as arrayUtil from "./../utils/array.js";
|
|
|
8
7
|
* https://github.com/timohausmann/quadtree-js/
|
|
9
8
|
**/
|
|
10
9
|
|
|
11
|
-
|
|
12
10
|
/**
|
|
13
11
|
* a pool of `QuadTree` objects
|
|
14
12
|
* @ignore
|
|
@@ -53,7 +51,7 @@ var QT_VECTOR = new Vector2d();
|
|
|
53
51
|
* a QuadTree implementation in JavaScript, a 2d spatial subdivision algorithm.
|
|
54
52
|
* @see game.world.broadphase
|
|
55
53
|
*/
|
|
56
|
-
class QuadTree {
|
|
54
|
+
export default class QuadTree {
|
|
57
55
|
/**
|
|
58
56
|
* @param {World} world - the physic world this QuadTree belongs to
|
|
59
57
|
* @param {Bounds} bounds - bounds of the node
|
|
@@ -70,7 +68,6 @@ class QuadTree {
|
|
|
70
68
|
this.max_levels = max_levels;
|
|
71
69
|
|
|
72
70
|
this.level = level;
|
|
73
|
-
this.bounds = bounds;
|
|
74
71
|
|
|
75
72
|
this.objects = [];
|
|
76
73
|
this.nodes = [];
|
|
@@ -89,7 +86,7 @@ class QuadTree {
|
|
|
89
86
|
//top right node
|
|
90
87
|
this.nodes[0] = QT_ARRAY_POP(
|
|
91
88
|
this.world,
|
|
92
|
-
|
|
89
|
+
{
|
|
93
90
|
left : left + subWidth,
|
|
94
91
|
top : top,
|
|
95
92
|
width : subWidth,
|
|
@@ -103,7 +100,7 @@ class QuadTree {
|
|
|
103
100
|
//top left node
|
|
104
101
|
this.nodes[1] = QT_ARRAY_POP(
|
|
105
102
|
this.world,
|
|
106
|
-
|
|
103
|
+
{
|
|
107
104
|
left : left,
|
|
108
105
|
top: top,
|
|
109
106
|
width : subWidth,
|
|
@@ -117,7 +114,7 @@ class QuadTree {
|
|
|
117
114
|
//bottom left node
|
|
118
115
|
this.nodes[2] = QT_ARRAY_POP(
|
|
119
116
|
this.world,
|
|
120
|
-
|
|
117
|
+
{
|
|
121
118
|
left : left,
|
|
122
119
|
top : top + subHeight,
|
|
123
120
|
width : subWidth,
|
|
@@ -131,7 +128,7 @@ class QuadTree {
|
|
|
131
128
|
//bottom right node
|
|
132
129
|
this.nodes[3] = QT_ARRAY_POP(
|
|
133
130
|
this.world,
|
|
134
|
-
|
|
131
|
+
{
|
|
135
132
|
left : left + subWidth,
|
|
136
133
|
top : top + subHeight,
|
|
137
134
|
width : subWidth,
|
|
@@ -156,7 +153,7 @@ class QuadTree {
|
|
|
156
153
|
if (item.isFloating === true) {
|
|
157
154
|
pos = this.world.app.viewport.localToWorld(bounds.left, bounds.top, QT_VECTOR);
|
|
158
155
|
} else {
|
|
159
|
-
pos = QT_VECTOR.set(
|
|
156
|
+
pos = QT_VECTOR.set(item.left, item.top);
|
|
160
157
|
}
|
|
161
158
|
|
|
162
159
|
var index = -1,
|
|
@@ -199,7 +196,7 @@ class QuadTree {
|
|
|
199
196
|
insertContainer(container) {
|
|
200
197
|
for (var i = container.children.length, child; i--, (child = container.children[i]);) {
|
|
201
198
|
if (child.isKinematic !== true) {
|
|
202
|
-
if (child
|
|
199
|
+
if (typeof child.addChild === "function") {
|
|
203
200
|
if (child.name !== "rootContainer") {
|
|
204
201
|
this.insert(child);
|
|
205
202
|
}
|
|
@@ -386,5 +383,3 @@ class QuadTree {
|
|
|
386
383
|
}
|
|
387
384
|
}
|
|
388
385
|
}
|
|
389
|
-
|
|
390
|
-
export default QuadTree;
|
package/src/physics/world.js
CHANGED
|
@@ -11,7 +11,7 @@ import state from "./../state/state.js";
|
|
|
11
11
|
* an object representing the physic world, and responsible for managing and updating all childs and physics
|
|
12
12
|
* @augments Container
|
|
13
13
|
*/
|
|
14
|
-
class World extends Container {
|
|
14
|
+
export default class World extends Container {
|
|
15
15
|
/**
|
|
16
16
|
* @param {number} [x=0] - position of the container (accessible via the inherited pos.x property)
|
|
17
17
|
* @param {number} [y=0] - position of the container (accessible via the inherited pos.y property)
|
|
@@ -209,4 +209,3 @@ class World extends Container {
|
|
|
209
209
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
export default World;
|
|
@@ -8,7 +8,7 @@ import pool from "./../system/pooling.js";
|
|
|
8
8
|
* a basic collectable helper class for immovable object (e.g. a coin)
|
|
9
9
|
* @augments Sprite
|
|
10
10
|
*/
|
|
11
|
-
class Collectable extends Sprite {
|
|
11
|
+
export default class Collectable extends Sprite {
|
|
12
12
|
/**
|
|
13
13
|
* @param {number} x - the x coordinates of the collectable
|
|
14
14
|
* @param {number} y - the y coordinates of the collectable
|
|
@@ -49,5 +49,3 @@ class Collectable extends Sprite {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
export default Collectable;
|
|
@@ -7,7 +7,7 @@ import Renderable from "./renderable.js";
|
|
|
7
7
|
* a generic Color Layer Object. Fills the entire Canvas with the color not just the container the object belongs to.
|
|
8
8
|
* @augments Renderable
|
|
9
9
|
*/
|
|
10
|
-
class ColorLayer extends Renderable {
|
|
10
|
+
export default class ColorLayer extends Renderable {
|
|
11
11
|
/**
|
|
12
12
|
* @param {string} name - Layer name
|
|
13
13
|
* @param {Color|string} color - CSS color
|
|
@@ -68,5 +68,3 @@ class ColorLayer extends Renderable {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
export default ColorLayer;
|