Skip to content

Commit 3d34143

Browse files
committed
17.2.0 dist files
1 parent 51ad03d commit 3d34143

File tree

548 files changed

+2580
-2168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

548 files changed

+2580
-2168
lines changed

dist/melonjs.mjs/_virtual/_commonjsHelpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/_virtual/earcut.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/_virtual/howler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/_virtual/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/_virtual/re.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/application/application.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license
@@ -187,7 +187,7 @@ class Application {
187187

188188
// identify parent element and/or the html target for resizing
189189
this.parentElement = getElement(this.settings.parent);
190-
if (typeof this.settings.scaleTarget !== "undefined" ) {
190+
if (typeof this.settings.scaleTarget !== "undefined") {
191191
this.settings.scaleTarget = getElement(this.settings.scaleTarget);
192192
}
193193

dist/melonjs.mjs/application/header.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license
@@ -27,7 +27,7 @@ function consoleHeader(app) {
2727
language
2828
);
2929

30-
console.log( "resolution: " + "requested " + app.settings.width + "x" + app.settings.height +
30+
console.log("resolution: " + "requested " + app.settings.width + "x" + app.settings.height +
3131
", got " + app.renderer.width + "x" + app.renderer.height
3232
);
3333
}

dist/melonjs.mjs/application/resize.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/application/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/audio/audio.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license
@@ -283,14 +283,15 @@ function rate(sound_name, ...args) {
283283
* @memberof audio
284284
* @param {string} sound_name - audio clip name - case sensitive
285285
* @param {number} [pan] - the panning value - A value of -1.0 is all the way left and 1.0 is all the way right.
286+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
286287
* @return {number} the current panning value
287288
* @example
288289
* me.audio.stereo("cling", -1);
289290
*/
290-
function stereo(sound_name, pan) {
291+
function stereo(sound_name, pan, id) {
291292
let sound = audioTracks[sound_name];
292293
if (sound && typeof sound !== "undefined") {
293-
return sound.stereo(pan);
294+
return sound.stereo(pan, id);
294295
} else {
295296
throw new Error("audio clip " + sound_name + " does not exist");
296297
}
@@ -303,12 +304,13 @@ function stereo(sound_name, pan) {
303304
* @param {Number} x - the x-position of the audio source.
304305
* @param {Number} y - the y-position of the audio source.
305306
* @param {Number} z - the z-position of the audio source.
307+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
306308
* @return {Array} the current 3D spatial position: [x, y, z]
307309
*/
308-
function position(sound_name, x, y, z) {
310+
function position(sound_name, x, y, z, id) {
309311
let sound = audioTracks[sound_name];
310312
if (sound && typeof sound !== "undefined") {
311-
return sound.pos(x, y, z);
313+
return sound.pos(x, y, z, id);
312314
} else {
313315
throw new Error("audio clip " + sound_name + " does not exist");
314316
}
@@ -322,12 +324,13 @@ function position(sound_name, x, y, z) {
322324
* @param {Number} x - the x-orientation of the audio source.
323325
* @param {Number} y - the y-orientation of the audio source.
324326
* @param {Number} z - the z-orientation of the audio source.
327+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
325328
* @return {Array} the current 3D spatial orientation: [x, y, z]
326329
*/
327-
function orientation(sound_name, x, y, z) {
330+
function orientation(sound_name, x, y, z, id) {
328331
let sound = audioTracks[sound_name];
329332
if (sound && typeof sound !== "undefined") {
330-
return sound.orientation(x, y, z);
333+
return sound.orientation(x, y, z, id);
331334
} else {
332335
throw new Error("audio clip " + sound_name + " does not exist");
333336
}
@@ -347,6 +350,7 @@ function orientation(sound_name, x, y, z) {
347350
* @param {string} [settings.refDistance=1] - A reference distance for reducing volume as source moves further from the listener. This is simply a variable of the distance model and has a different effect depending on which model is used and the scale of your coordinates. Generally, volume will be equal to 1 at this distance.
348351
* @param {string} [settings.rolloffFactor=1] - How quickly the volume reduces as source moves from listener. This is simply a variable of the distance model and can be in the range of `[0, 1]` with `linear` and `[0, ∞]` with `inverse` and `exponential`.
349352
* @param {string} [settings.panningModel="HRTF"] - Determines which spatialization algorithm is used to position audio. Can be `HRTF` or `equalpower`.
353+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
350354
* @return {Object} current panner attributes.
351355
* @example
352356
* me.audio.panner("cling", {
@@ -356,10 +360,10 @@ function orientation(sound_name, x, y, z) {
356360
* distanceModel: 'exponential'
357361
* });
358362
*/
359-
function panner(sound_name, attributes) {
363+
function panner(sound_name, attributes, id) {
360364
let sound = audioTracks[sound_name];
361365
if (sound && typeof sound !== "undefined") {
362-
return sound.pannerAttr(attributes);
366+
return sound.pannerAttr(attributes, id);
363367
} else {
364368
throw new Error("audio clip " + sound_name + " does not exist");
365369
}

dist/melonjs.mjs/camera/camera2d.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/const.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/ellipse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/line.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/path2d.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license
@@ -71,12 +71,12 @@ class Path2D {
7171
break;
7272
case "H":
7373
// H take 1 coordinate
74-
lastPoint = points.length === 0 ? startPoint : points[points.length-1];
74+
lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
7575
this.lineTo(lastPoint.x + coordinates[0], lastPoint.y);
7676
break;
7777
case "V":
7878
// V take 1 coordinate
79-
lastPoint = points.length === 0 ? startPoint : points[points.length-1];
79+
lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
8080
this.lineTo(lastPoint.x, lastPoint.y + coordinates[0]);
8181
break;
8282
case "M":
@@ -128,7 +128,7 @@ class Path2D {
128128
let points = this.points;
129129
if (points.length > 0) {
130130
let firstPoint = points[0];
131-
if (!firstPoint.equals(points[points.length-1])) {
131+
if (!firstPoint.equals(points[points.length - 1])) {
132132
this.lineTo(firstPoint.x, firstPoint.y);
133133
}
134134
this.isDirty = true;
@@ -153,14 +153,14 @@ class Path2D {
153153
}
154154

155155
// calculate all vertices
156-
for (let i = 0; i < indicesLength; i++ ) {
156+
for (let i = 0; i < indicesLength; i++) {
157157
let point = points[indices[i]];
158158
vertices[i].set(point.x, point.y);
159159
}
160160

161161
// recycle overhead from a previous triangulation
162162
while (vertices.length > indicesLength) {
163-
pool.push(vertices[vertices.length-1]);
163+
pool.push(vertices[vertices.length - 1]);
164164
vertices.length -= 1;
165165
}
166166
this.isDirty = false;
@@ -187,7 +187,7 @@ class Path2D {
187187
lineTo(x, y) {
188188
let points = this.points;
189189
let startPoint = this.startPoint;
190-
let lastPoint = points.length === 0 ? startPoint : points[points.length-1];
190+
let lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
191191

192192
if (!startPoint.equals(lastPoint)) {
193193
points.push(pool.pull("Point", startPoint.x, startPoint.y));
@@ -216,7 +216,7 @@ class Path2D {
216216
// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
217217
//bring angles all in [0, 2*PI] range
218218
if (startAngle === endAngle) return;
219-
const fullCircle = anticlockwise ? Math.abs(startAngle-endAngle) >= (TAU) : Math.abs(endAngle-startAngle) >= (TAU);
219+
const fullCircle = anticlockwise ? Math.abs(startAngle - endAngle) >= (TAU) : Math.abs(endAngle - startAngle) >= (TAU);
220220

221221
startAngle = startAngle % (TAU);
222222
endAngle = endAngle % (TAU);
@@ -225,7 +225,7 @@ class Path2D {
225225
if (endAngle < 0) endAngle += TAU;
226226

227227
if (startAngle >= endAngle) {
228-
endAngle+= TAU;
228+
endAngle += TAU;
229229
}
230230

231231
let diff = endAngle - startAngle;
@@ -266,7 +266,7 @@ class Path2D {
266266
arcTo(x1, y1, x2, y2, radius) {
267267
let points = this.points;
268268
let startPoint = this.startPoint;
269-
let lastPoint = points.length === 0 ? startPoint : points[points.length-1];
269+
let lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
270270

271271
// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
272272
let x0 = lastPoint.x, y0 = lastPoint.y;
@@ -281,8 +281,8 @@ class Path2D {
281281
let angle = Math.atan2(a1, a0) - Math.atan2(b1, b0);
282282

283283
//work out tangent points using tan(θ) = opposite / adjacent; angle/2 because hypotenuse is the bisection of a,b
284-
let tan_angle_div2 = Math.tan(angle/2);
285-
let adj_l = (radius/tan_angle_div2);
284+
let tan_angle_div2 = Math.tan(angle / 2);
285+
let adj_l = (radius / tan_angle_div2);
286286

287287
let tangent1_pointx = x1 + a0 * adj_l, tangent1_pointy = y1 + a1 * adj_l;
288288
let tangent2_pointx = x1 + b0 * adj_l, tangent2_pointy = y1 + b1 * adj_l;
@@ -317,15 +317,15 @@ class Path2D {
317317
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
318318
// based on from https://github.com/karellodewijk/canvas-webgl/blob/master/canvas-webgl.js
319319
if (startAngle === endAngle) return;
320-
let fullCircle = anticlockwise ? Math.abs(startAngle-endAngle) >= (TAU) : Math.abs(endAngle-startAngle) >= (TAU);
320+
let fullCircle = anticlockwise ? Math.abs(startAngle - endAngle) >= (TAU) : Math.abs(endAngle - startAngle) >= (TAU);
321321

322322
//bring angles all in [0, 2*PI] range
323323
startAngle = startAngle % (TAU);
324324
endAngle = endAngle % (TAU);
325325
if (startAngle < 0) startAngle += TAU;
326326
if (endAngle < 0) endAngle += TAU;
327327

328-
if (startAngle>=endAngle) {
328+
if (startAngle >= endAngle) {
329329
endAngle += TAU;
330330
}
331331

@@ -355,7 +355,7 @@ class Path2D {
355355
const _y1 = radiusY * Math.sin(angle);
356356
const _x2 = x + _x1 * cos_rotation - _y1 * sin_rotation;
357357
const _y2 = y + _x1 * sin_rotation + _y1 * cos_rotation;
358-
this.lineTo( _x2, _y2);
358+
this.lineTo(_x2, _y2);
359359
angle += angleStep;
360360
}
361361
// close the ellipse
@@ -373,7 +373,7 @@ class Path2D {
373373
quadraticCurveTo(cpX, cpY, x, y) {
374374
const points = this.points;
375375
const startPoint = this.startPoint;
376-
const lastPoint = points.length === 0 ? startPoint : points[points.length-1];
376+
const lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
377377
const endPoint = pool.pull("Point").set(x, y);
378378
const controlPoint = pool.pull("Point").set(cpX, cpY);
379379
const resolution = this.arcResolution;
@@ -401,7 +401,7 @@ class Path2D {
401401
bezierCurveTo(cp1X, cp1Y, cp2X, cp2Y, x, y) {
402402
const points = this.points;
403403
const startPoint = this.startPoint;
404-
const lastPoint = points.length === 0 ? startPoint : points[points.length-1];
404+
const lastPoint = points.length === 0 ? startPoint : points[points.length - 1];
405405
const endPoint = pool.pull("Point").set(x, y);
406406
const controlPoint1 = pool.pull("Point").set(cp1X, cp1Y);
407407
const controlPoint2 = pool.pull("Point").set(cp2X, cp2Y);

dist/melonjs.mjs/geometries/point.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/poly.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/rectangle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/roundrect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license

dist/melonjs.mjs/geometries/toarccanvas.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* melonJS Game Engine - v17.1.0
2+
* melonJS Game Engine - v17.2.0
33
* http://www.melonjs.org
44
* melonjs is licensed under the MIT License.
55
* http://www.opensource.org/licenses/mit-license
@@ -60,7 +60,7 @@ function endpointToCenterParameterization(x1, y1, x2, y2, largeArcFlag, sweepFla
6060

6161
const [rx, ry] = correctRadii(srx, sry, x1p, y1p);
6262

63-
const sign = largeArcFlag !== sweepFlag ? 1 : -1;
63+
const sign = -1;
6464
const n = pow(rx) * pow(ry) - pow(rx) * pow(y1p) - pow(ry) * pow(x1p);
6565
const d = pow(rx) * pow(y1p) + pow(ry) * pow(x1p);
6666

@@ -80,11 +80,9 @@ function endpointToCenterParameterization(x1, y1, x2, y2, largeArcFlag, sweepFla
8080
const deltaAngle0 = vec2Angle(a, b) % (2 * Math.PI);
8181

8282
const deltaAngle =
83-
!sweepFlag && deltaAngle0 > 0
83+
deltaAngle0 > 0
8484
? deltaAngle0 - 2 * Math.PI
85-
: sweepFlag && deltaAngle0 < 0
86-
? deltaAngle0 + 2 * Math.PI
87-
: deltaAngle0;
85+
: deltaAngle0;
8886

8987
const endAngle = startAngle + deltaAngle;
9088

0 commit comments

Comments
 (0)