melonjs 19.4.0 → 19.5.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/README.md +18 -2
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +25 -2
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +77 -253
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend.d.ts +121 -0
- package/build/audio/backend.d.ts.map +1 -0
- package/build/audio/playback.d.ts +157 -0
- package/build/audio/playback.d.ts.map +1 -0
- package/build/audio/procedural.d.ts +105 -0
- package/build/audio/procedural.d.ts.map +1 -0
- package/build/audio/types.d.ts +205 -0
- package/build/audio/types.d.ts.map +1 -0
- package/build/index.d.ts +6 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2273 -379
- package/build/index.js.map +4 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +12 -0
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +1 -1
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/factories/tile.d.ts.map +1 -1
- package/build/loader/loader.d.ts +2 -2
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/parsers/aseprite.d.ts +37 -0
- package/build/loader/parsers/aseprite.d.ts.map +1 -0
- package/build/physics/adapter.d.ts +560 -0
- package/build/physics/adapter.d.ts.map +1 -0
- package/build/physics/bounds.d.ts +18 -5
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +605 -0
- package/build/physics/builtin/body.d.ts.map +1 -0
- package/build/physics/builtin/builtin-adapter.d.ts +91 -0
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -0
- package/build/physics/builtin/detector.d.ts +167 -0
- package/build/physics/builtin/detector.d.ts.map +1 -0
- package/build/physics/builtin/quadtree.d.ts +112 -0
- package/build/physics/builtin/quadtree.d.ts.map +1 -0
- package/build/physics/builtin/raycast.d.ts +4 -0
- package/build/physics/builtin/raycast.d.ts.map +1 -0
- package/build/physics/{sat.d.ts → builtin/sat.d.ts} +7 -7
- package/build/physics/builtin/sat.d.ts.map +1 -0
- package/build/physics/world.d.ts +61 -26
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +7 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/container.d.ts +0 -13
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +78 -17
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +14 -1
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/system/timer.d.ts +0 -5
- package/build/system/timer.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +0 -130
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/renderer.d.ts +111 -0
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/effects/shine.d.ts +87 -0
- package/build/video/webgl/effects/shine.d.ts.map +1 -0
- package/build/video/webgl/webgl_renderer.d.ts +0 -106
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/build/physics/body.d.ts +0 -351
- package/build/physics/body.d.ts.map +0 -1
- package/build/physics/detector.d.ts +0 -72
- package/build/physics/detector.d.ts.map +0 -1
- package/build/physics/quadtree.d.ts +0 -69
- package/build/physics/quadtree.d.ts.map +0 -1
- package/build/physics/sat.d.ts.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export default Detector;
|
|
2
|
-
/**
|
|
3
|
-
* the Detector class contains methods for detecting collisions between bodies using a broadphase algorithm.
|
|
4
|
-
*/
|
|
5
|
-
declare class Detector {
|
|
6
|
-
/**
|
|
7
|
-
* @param {Container} world - the physic world this detector is bind to
|
|
8
|
-
*/
|
|
9
|
-
constructor(world: Container);
|
|
10
|
-
world: Container;
|
|
11
|
-
/**
|
|
12
|
-
* the default response object used for collisions
|
|
13
|
-
* (will be automatically populated by the collides functions)
|
|
14
|
-
* @type {ResponseObject}
|
|
15
|
-
*/
|
|
16
|
-
response: ResponseObject;
|
|
17
|
-
/**
|
|
18
|
-
* determine if two objects should collide (based on both respective objects body collision mask and type).<br>
|
|
19
|
-
* you can redefine this function if you need any specific rules over what should collide with what.
|
|
20
|
-
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
21
|
-
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
22
|
-
* @returns {boolean} true if they should collide, false otherwise
|
|
23
|
-
*/
|
|
24
|
-
shouldCollide(a: Renderable | Container | Entity | Sprite | NineSliceSprite, b: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* detect collision between two bodies.
|
|
27
|
-
* @param {Body} bodyA - a reference to body A.
|
|
28
|
-
* @param {Body} bodyB - a reference to body B.
|
|
29
|
-
* @returns {boolean} true if colliding
|
|
30
|
-
*/
|
|
31
|
-
collides(bodyA: Body, bodyB: Body, response?: ResponseObject): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* find all the collisions for the specified object using a broadphase algorithm
|
|
34
|
-
* @ignore
|
|
35
|
-
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} objA - object to be tested for collision
|
|
36
|
-
* @returns {boolean} in case of collision, false otherwise
|
|
37
|
-
*/
|
|
38
|
-
collisions(objA: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Checks for object colliding with the given line
|
|
41
|
-
* @ignore
|
|
42
|
-
* @param {Line} line - line to be tested for collision
|
|
43
|
-
* @param {Array.<Renderable>} [result] - a user defined array that will be populated with intersecting physic objects.
|
|
44
|
-
* @returns {Array.<Renderable>} an array of intersecting physic objects
|
|
45
|
-
* @example
|
|
46
|
-
* // define a line accross the viewport
|
|
47
|
-
* let ray = new Line(
|
|
48
|
-
* // absolute position of the line
|
|
49
|
-
* 0, 0, [
|
|
50
|
-
* // starting point relative to the initial position
|
|
51
|
-
* new Vector2d(0, 0),
|
|
52
|
-
* // ending point
|
|
53
|
-
* new Vector2d(app.viewport.width, app.viewport.height)
|
|
54
|
-
* ]);
|
|
55
|
-
*
|
|
56
|
-
* // check for collition
|
|
57
|
-
* result = me.collision.rayCast(ray);
|
|
58
|
-
*
|
|
59
|
-
* if (result.length > 0) {
|
|
60
|
-
* // ...
|
|
61
|
-
* }
|
|
62
|
-
*/
|
|
63
|
-
rayCast(line: Line, result?: Array<Renderable>): Array<Renderable>;
|
|
64
|
-
}
|
|
65
|
-
import type Container from "./../renderable/container.js";
|
|
66
|
-
import ResponseObject from "./response.js";
|
|
67
|
-
import type Renderable from "./../renderable/renderable.js";
|
|
68
|
-
import type Entity from "./../renderable/entity/entity.js";
|
|
69
|
-
import type Sprite from "./../renderable/sprite.js";
|
|
70
|
-
import type NineSliceSprite from "./../renderable/nineslicesprite.js";
|
|
71
|
-
import type { Line } from "./../geometries/line.ts";
|
|
72
|
-
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../src/physics/detector.js"],"names":[],"mappings":";AAuDA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EAYnB;IARA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAGrC;;;;;;OAMG;IACH,iBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,KAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,gBAJW,IAAI,SACJ,IAAI,8BACF,OAAO,CAkCnB;IAED;;;;;OAKG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAsGnB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAiE9B;CACD;2BA5RyB,8BAA8B;2BA/B7B,eAAe;4BAgCf,+BAA+B;wBAFnC,kCAAkC;wBAGlC,2BAA2B;iCAClB,oCAAoC;0BAC7C,yBAAyB"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* a QuadTree implementation in JavaScript, a 2d spatial subdivision algorithm.
|
|
3
|
-
* @category Physics
|
|
4
|
-
* @see game.world.broadphase
|
|
5
|
-
*/
|
|
6
|
-
export default class QuadTree {
|
|
7
|
-
/**
|
|
8
|
-
* @param {World} world - the physic world this QuadTree belongs to
|
|
9
|
-
* @param {Bounds} bounds - bounds of the node
|
|
10
|
-
* @param {number} [max_objects=4] - max objects a node can hold before splitting into 4 subnodes
|
|
11
|
-
* @param {number} [max_levels=4] - total max levels inside root Quadtree
|
|
12
|
-
* @param {number} [level] - deepth level, required for subnodes
|
|
13
|
-
*/
|
|
14
|
-
constructor(world: World, bounds: Bounds, max_objects?: number, max_levels?: number, level?: number);
|
|
15
|
-
world: World;
|
|
16
|
-
bounds: Bounds;
|
|
17
|
-
max_objects: number;
|
|
18
|
-
max_levels: number;
|
|
19
|
-
level: number;
|
|
20
|
-
objects: any[];
|
|
21
|
-
nodes: any[];
|
|
22
|
-
split(): void;
|
|
23
|
-
getIndex(item: any): number;
|
|
24
|
-
/**
|
|
25
|
-
* Insert the given object container into the node.
|
|
26
|
-
* @param {Container} container - group of objects to be added
|
|
27
|
-
*/
|
|
28
|
-
insertContainer(container: Container): void;
|
|
29
|
-
/**
|
|
30
|
-
* Insert the given object into the node. If the node
|
|
31
|
-
* exceeds the capacity, it will split and add all
|
|
32
|
-
* objects to their corresponding subnodes.
|
|
33
|
-
* @param {object} item - object to be added
|
|
34
|
-
*/
|
|
35
|
-
insert(item: object): void;
|
|
36
|
-
/**
|
|
37
|
-
* Return all objects that could collide with the given object
|
|
38
|
-
* @param {object} item - object to be checked against
|
|
39
|
-
* @param {object} [fn] - a sorting function for the returned array
|
|
40
|
-
* @returns {object[]} array with all detected objects
|
|
41
|
-
*/
|
|
42
|
-
retrieve(item: object, fn?: object, result: any): object[];
|
|
43
|
-
/**
|
|
44
|
-
* Remove the given item from the quadtree.
|
|
45
|
-
* (this function won't recalculate the impacted node)
|
|
46
|
-
* @param {object} item - object to be removed
|
|
47
|
-
* @returns {boolean} true if the item was found and removed.
|
|
48
|
-
*/
|
|
49
|
-
remove(item: object): boolean;
|
|
50
|
-
/**
|
|
51
|
-
* return true if the node is prunable
|
|
52
|
-
* @returns {boolean} true if the node is prunable
|
|
53
|
-
*/
|
|
54
|
-
isPrunable(): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* return true if the node has any children
|
|
57
|
-
* @returns {boolean} true if the node has any children
|
|
58
|
-
*/
|
|
59
|
-
hasChildren(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* clear the quadtree
|
|
62
|
-
* @param {Bounds} [bounds=this.bounds] - the bounds to be cleared
|
|
63
|
-
*/
|
|
64
|
-
clear(bounds?: Bounds): void;
|
|
65
|
-
}
|
|
66
|
-
import type World from "./world.js";
|
|
67
|
-
import type { Bounds } from "./bounds.ts";
|
|
68
|
-
import type Container from "./../renderable/container.js";
|
|
69
|
-
//# sourceMappingURL=quadtree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quadtree.d.ts","sourceRoot":"","sources":["../../src/physics/quadtree.js"],"names":[],"mappings":"AA2DA;;;;GAIG;AACH;IACC;;;;;;OAMG;IACH,mBANW,KAAK,UACL,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,EAahB;IAVA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