@datamoc/mw_games 0.25.0 → 0.27.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/CHANGELOG.md +192 -0
- package/README.md +15 -0
- package/api-surface.json +14942 -0
- package/dist/actors/StatBlock.d.ts +2 -4
- package/dist/actors/StatBlock.d.ts.map +1 -1
- package/dist/actors/StatBlock.js +2 -4
- package/dist/actors/StatBlock.js.map +1 -1
- package/dist/ai/Heuristics.d.ts +1 -1
- package/dist/ai/Heuristics.js +1 -1
- package/dist/ai/Suggest.d.ts +54 -0
- package/dist/ai/Suggest.d.ts.map +1 -0
- package/dist/ai/Suggest.js +48 -0
- package/dist/ai/Suggest.js.map +1 -0
- package/dist/ai/index.d.ts +2 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/core/Blob.d.ts.map +1 -1
- package/dist/core/Blob.js +2 -8
- package/dist/core/Blob.js.map +1 -1
- package/dist/core/Grid.d.ts +115 -0
- package/dist/core/Grid.d.ts.map +1 -1
- package/dist/core/Grid.js +125 -0
- package/dist/core/Grid.js.map +1 -1
- package/dist/core/HttpTransport.d.ts +14 -0
- package/dist/core/HttpTransport.d.ts.map +1 -1
- package/dist/core/HttpTransport.js +14 -0
- package/dist/core/HttpTransport.js.map +1 -1
- package/dist/core/Random.d.ts +63 -13
- package/dist/core/Random.d.ts.map +1 -1
- package/dist/core/Random.js +28 -25
- package/dist/core/Random.js.map +1 -1
- package/dist/core/Replay.d.ts +28 -4
- package/dist/core/Replay.d.ts.map +1 -1
- package/dist/core/Replay.js +38 -9
- package/dist/core/Replay.js.map +1 -1
- package/dist/core/ReplayFile.d.ts +197 -0
- package/dist/core/ReplayFile.d.ts.map +1 -0
- package/dist/core/ReplayFile.js +257 -0
- package/dist/core/ReplayFile.js.map +1 -0
- package/dist/core/index.d.ts +9 -5
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/headless/index.d.ts +87 -0
- package/dist/headless/index.d.ts.map +1 -0
- package/dist/headless/index.js +87 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/mw_games.global.js +113 -113
- package/dist/mwl/index.d.ts +1 -1
- package/dist/mwl/index.d.ts.map +1 -1
- package/dist/mwl/index.js.map +1 -1
- package/dist/roguelike/Level.d.ts +1 -1
- package/dist/roguelike/Level.d.ts.map +1 -1
- package/dist/roguelike/Level.js +3 -21
- package/dist/roguelike/Level.js.map +1 -1
- package/dist/roguelike/Targeting.d.ts.map +1 -1
- package/dist/roguelike/Targeting.js +2 -1
- package/dist/roguelike/Targeting.js.map +1 -1
- package/dist/rpg/index.d.ts +1 -1
- package/dist/rpg/index.d.ts.map +1 -1
- package/dist/simulation/Training.d.ts +77 -0
- package/dist/simulation/Training.d.ts.map +1 -1
- package/dist/simulation/Training.js +87 -0
- package/dist/simulation/Training.js.map +1 -1
- package/dist/simulation/index.d.ts +2 -2
- package/dist/simulation/index.d.ts.map +1 -1
- package/dist/simulation/index.js +1 -1
- package/dist/simulation/index.js.map +1 -1
- package/dist/two-d/pixi-interop.d.ts +24 -1
- package/dist/two-d/pixi-interop.d.ts.map +1 -1
- package/dist/two-d/pixi-interop.js +23 -1
- package/dist/two-d/pixi-interop.js.map +1 -1
- package/dist/two-d/render/Beam.d.ts +93 -0
- package/dist/two-d/render/Beam.d.ts.map +1 -0
- package/dist/two-d/render/Beam.js +154 -0
- package/dist/two-d/render/Beam.js.map +1 -0
- package/dist/two-d/render/Flights.d.ts +79 -0
- package/dist/two-d/render/Flights.d.ts.map +1 -0
- package/dist/two-d/render/Flights.js +120 -0
- package/dist/two-d/render/Flights.js.map +1 -0
- package/dist/two-d/render/Particles.d.ts +48 -0
- package/dist/two-d/render/Particles.d.ts.map +1 -1
- package/dist/two-d/render/Particles.js +59 -1
- package/dist/two-d/render/Particles.js.map +1 -1
- package/dist/two-d/render/index.d.ts +6 -2
- package/dist/two-d/render/index.d.ts.map +1 -1
- package/dist/two-d/render/index.js +2 -0
- package/dist/two-d/render/index.js.map +1 -1
- package/dist/two-d/ui/MessageLog.d.ts +28 -0
- package/dist/two-d/ui/MessageLog.d.ts.map +1 -1
- package/dist/two-d/ui/MessageLog.js +23 -6
- package/dist/two-d/ui/MessageLog.js.map +1 -1
- package/dist/two-d/ui/TextPrompt.d.ts +115 -0
- package/dist/two-d/ui/TextPrompt.d.ts.map +1 -0
- package/dist/two-d/ui/TextPrompt.js +227 -0
- package/dist/two-d/ui/TextPrompt.js.map +1 -0
- package/dist/two-d/ui/index.d.ts +4 -2
- package/dist/two-d/ui/index.d.ts.map +1 -1
- package/dist/two-d/ui/index.js +2 -1
- package/dist/two-d/ui/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +16 -3
- package/sbom.cdx.json +6 -6
- package/tools/audit-adoptions.d.mts +65 -0
- package/tools/audit-adoptions.mjs +252 -0
- package/tools/browser-driver.d.mts +78 -0
- package/tools/browser-driver.mjs +642 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-interop.d.ts","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pixi-interop.d.ts","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gPAAgP;AAChP,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,+OAA+O;AAC/O,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,+OAA+O;AAC/O,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,uLAAuL;AACvL,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,sOAAsO;AACtO,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,0LAA0L;AAC1L,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,wNAAwN;AACxN,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,4OAA4O;AAC5O,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,6IAA6I;AAC7I,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAChE,0FAA0F;AAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAM3C"}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* bundler and tree-shaking configuration the *consumer* uses, not a universal one, and the
|
|
22
22
|
* port whose build tree-shook a pipe away is exactly the case this function is for.
|
|
23
23
|
*
|
|
24
|
+
* Facade-gap accounting (P31): every primitive below already has a facade family, so no new
|
|
25
|
+
* facade coverage was needed - what stays interop-only is the Pixi-typed seam each note
|
|
26
|
+
* names, and a consumer budget justifies a use by pointing at the note instead of merely
|
|
27
|
+
* counting the import.
|
|
28
|
+
*
|
|
24
29
|
* @example
|
|
25
30
|
* ```ts
|
|
26
31
|
* import { registerBuiltinPipes, TilingSprite } from '@datamoc/mw_games/two-d/pixi-interop';
|
|
@@ -31,7 +36,24 @@
|
|
|
31
36
|
* const backdrop = new TilingSprite({ texture: undefined as never, width: 100, height: 100 });
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
|
-
|
|
39
|
+
/** Interop-only: the unadorned scene-graph node behind facade `Container2D`/`Node2D`. The facade subclasses it rather than wrapping it, so a value that never needed the subclass - or a Pixi API typed against the base - still names this. */
|
|
40
|
+
export { Container } from 'pixi.js';
|
|
41
|
+
/** Interop-only: the textured quad behind facade `Sprite2D`/`TintedSprite`/`AnimatedSprite`. Same subclass relationship: reach for this for Pixi sprite behaviour the facade subclasses do not model, not for an ordinary positioned image. */
|
|
42
|
+
export { Sprite } from 'pixi.js';
|
|
43
|
+
/** Interop-only: the GPU image behind facade `Texture2D`/`TextureRegion`. `TextureRegion` still carries one in its `texture` slot, and Pixi constructors (sprites, tilings, nine-slices, render textures) take one - that slot is the seam. */
|
|
44
|
+
export { Texture } from 'pixi.js';
|
|
45
|
+
/** Interop-only: the vector canvas behind facade `Shape2D`. `Shape2D` extends this with the game's fill/stroke vocabulary; a `Graphics` program outside that vocabulary stays here. */
|
|
46
|
+
export { Graphics } from 'pixi.js';
|
|
47
|
+
/** Interop-only: the Pixi rect behind facade `Rect`. Atlas frames, bounds and hit areas arrive as one; `render.rectOf` converts it to a plain `Rect` at the boundary, and code that hands a rect straight back to Pixi keeps this. */
|
|
48
|
+
export { Rectangle } from 'pixi.js';
|
|
49
|
+
/** Interop-only: the text node behind facade `Text2D`. Same subclass relationship as `Sprite`: ordinary labels are `Text2D`; Pixi text behaviour the facade does not model stays here. */
|
|
50
|
+
export { Text } from 'pixi.js';
|
|
51
|
+
/** Interop-only: the gradient behind facade `Gradient` (which is this, aliased). `Shape2D.fill`/`.stroke` accept it directly, so most gradient work never imports it; direct construction of a gradient object does. */
|
|
52
|
+
export { FillGradient } from 'pixi.js';
|
|
53
|
+
/** Interop-only: the repeating texture behind facade `TiledSprite`. `TiledSprite` extends this; tiling behaviour outside the facade's repeat/offset surface stays here (and needs `registerBuiltinPipes` in a tree-shaken build, below). */
|
|
54
|
+
export { TilingSprite } from 'pixi.js';
|
|
55
|
+
/** Interop-only: renderer pipes, not scene content. Only needed when a consumer bundler tree-shook them away; see `registerBuiltinPipes`. */
|
|
56
|
+
export { TilingSpritePipe, NineSliceSpritePipe } from 'pixi.js';
|
|
35
57
|
import { extensions, TilingSpritePipe, NineSliceSpritePipe } from 'pixi.js';
|
|
36
58
|
let registered = false;
|
|
37
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-interop.js","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pixi-interop.js","sourceRoot":"","sources":["../../src/two-d/pixi-interop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,gPAAgP;AAChP,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,+OAA+O;AAC/O,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,+OAA+O;AAC/O,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,uLAAuL;AACvL,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,sOAAsO;AACtO,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,0LAA0L;AAC1L,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,wNAAwN;AACxN,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,4OAA4O;AAC5O,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,6IAA6I;AAC7I,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAIhE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5E,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB;IACnC,IAAI,UAAU;QAAE,OAAO;IACvB,UAAU,GAAG,IAAI,CAAC;IAElB,UAAU,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACjC,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Container } from 'pixi.js';
|
|
2
|
+
import type { Texture2D } from './Types2D.ts';
|
|
3
|
+
export interface BeamPoint {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
export interface BeamOptions {
|
|
8
|
+
/** plain-line colour; ignored with `texture`. Default white */
|
|
9
|
+
colour?: number;
|
|
10
|
+
/** repeating strip drawn instead of a plain line */
|
|
11
|
+
texture?: Texture2D;
|
|
12
|
+
/** seconds till `done`; default 0.2 */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** line width, or strip height with a texture; default 2 */
|
|
15
|
+
width?: number;
|
|
16
|
+
/** additive blend; default true, set false for a solid beam */
|
|
17
|
+
additive?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A one-shot beam between two screen points: a fading line by default, a fading
|
|
21
|
+
* repeating texture strip with `texture`. The sub-second ray flash - a zap, a laser,
|
|
22
|
+
* a life-link - where `LightningArc` is the persistent jittered geometry and
|
|
23
|
+
* `MultiTurnBeam` the multi-turn case.
|
|
24
|
+
*
|
|
25
|
+
* Fades from full to gone across `duration` and reports `done` exactly once, so a
|
|
26
|
+
* group can remove it without a second clock. `retarget` moves either endpoint for
|
|
27
|
+
* a beam tracking two moving points; z-order and parenting stay the caller's.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { Beam } from '@datamoc/mw_games/two-d/render';
|
|
32
|
+
*
|
|
33
|
+
* const zap = new Beam({ x: 0, y: 0 }, { x: 100, y: 0 }, { colour: 0x88ccff, duration: 0.2 });
|
|
34
|
+
* const expired = zap.update(0.25);
|
|
35
|
+
* console.log(expired); // true - the instant it outlives its duration
|
|
36
|
+
* zap.destroy();
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class Beam extends Container {
|
|
40
|
+
private from;
|
|
41
|
+
private to;
|
|
42
|
+
private readonly colour;
|
|
43
|
+
private readonly texture?;
|
|
44
|
+
private readonly thickness;
|
|
45
|
+
private readonly duration;
|
|
46
|
+
private readonly body;
|
|
47
|
+
private elapsed;
|
|
48
|
+
private expired;
|
|
49
|
+
constructor(from: BeamPoint, to: BeamPoint, options?: BeamOptions);
|
|
50
|
+
/** 0 at launch, 1 at duration end */
|
|
51
|
+
get progress(): number;
|
|
52
|
+
get done(): boolean;
|
|
53
|
+
/** moves either endpoint, for a beam tracking two points that are themselves moving */
|
|
54
|
+
retarget(from?: BeamPoint, to?: BeamPoint): void;
|
|
55
|
+
/** @returns true the instant `duration` elapses, so a caller can remove the beam exactly once */
|
|
56
|
+
update(dt: number): boolean;
|
|
57
|
+
destroy(): void;
|
|
58
|
+
private redraw;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Owns the beams a game has flashing: one `add` per ray, one `update(dt)` fading
|
|
62
|
+
* them all and forgetting the finished ones, and no bookkeeping left to the caller.
|
|
63
|
+
* Beams are parented here and destroyed with their beam; z-order stays the caller's.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { Beams } from '@datamoc/mw_games/two-d/render';
|
|
68
|
+
* import type { Container2D } from '@datamoc/mw_games/two-d/render';
|
|
69
|
+
*
|
|
70
|
+
* declare const layer: Container2D;
|
|
71
|
+
*
|
|
72
|
+
* const beams = new Beams();
|
|
73
|
+
* layer.addChild(beams);
|
|
74
|
+
*
|
|
75
|
+
* beams.add({ x: 0, y: 0 }, { x: 100, y: 0 }, { colour: 0x88ccff });
|
|
76
|
+
* beams.update(1 / 60);
|
|
77
|
+
* console.log(beams.count); // 1 - still fading
|
|
78
|
+
* beams.clear();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare class Beams extends Container {
|
|
82
|
+
private readonly live;
|
|
83
|
+
/** flashes a beam between two points; it fades on `update` and removes itself at duration end */
|
|
84
|
+
add(from: BeamPoint, to: BeamPoint, options?: BeamOptions): Beam;
|
|
85
|
+
/** fades every live beam, then forgets and destroys the finished ones */
|
|
86
|
+
update(dt: number): void;
|
|
87
|
+
/** how many beams are still fading */
|
|
88
|
+
get count(): number;
|
|
89
|
+
/** drops every live beam at once - a scene change, say */
|
|
90
|
+
clear(): void;
|
|
91
|
+
destroy(): void;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=Beam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Beam.d.ts","sourceRoot":"","sources":["../../../src/two-d/render/Beam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0B,MAAM,SAAS,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,SAAS;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACV;AAED,MAAM,WAAW,WAAW;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,IAAK,SAAQ,SAAS;IAClC,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,EAAE,CAAY;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA0B;IAE/C,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAS;IAExB,YAAY,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,GAAE,WAAgB,EAiBpE;IAED,qCAAqC;IACrC,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,uFAAuF;IACvF,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,EAAE,SAAS,GAAG,IAAI,CAI/C;IAED,iGAAiG;IACjG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAU1B;IAEQ,OAAO,IAAI,IAAI,CAIvB;IAED,OAAO,CAAC,MAAM;CAkBd;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IAEnC,iGAAiG;IACjG,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAK/D;IAED,yEAAyE;IACzE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAQvB;IAED,sCAAsC;IACtC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,0DAA0D;IAC1D,KAAK,IAAI,IAAI,CAKZ;IAEQ,OAAO,IAAI,IAAI,CAGvB;CACD"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { Container, Graphics, TilingSprite } from 'pixi.js';
|
|
2
|
+
/**
|
|
3
|
+
* A one-shot beam between two screen points: a fading line by default, a fading
|
|
4
|
+
* repeating texture strip with `texture`. The sub-second ray flash - a zap, a laser,
|
|
5
|
+
* a life-link - where `LightningArc` is the persistent jittered geometry and
|
|
6
|
+
* `MultiTurnBeam` the multi-turn case.
|
|
7
|
+
*
|
|
8
|
+
* Fades from full to gone across `duration` and reports `done` exactly once, so a
|
|
9
|
+
* group can remove it without a second clock. `retarget` moves either endpoint for
|
|
10
|
+
* a beam tracking two moving points; z-order and parenting stay the caller's.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Beam } from '@datamoc/mw_games/two-d/render';
|
|
15
|
+
*
|
|
16
|
+
* const zap = new Beam({ x: 0, y: 0 }, { x: 100, y: 0 }, { colour: 0x88ccff, duration: 0.2 });
|
|
17
|
+
* const expired = zap.update(0.25);
|
|
18
|
+
* console.log(expired); // true - the instant it outlives its duration
|
|
19
|
+
* zap.destroy();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export class Beam extends Container {
|
|
23
|
+
constructor(from, to, options = {}) {
|
|
24
|
+
super();
|
|
25
|
+
this.elapsed = 0;
|
|
26
|
+
this.expired = false;
|
|
27
|
+
this.from = { ...from };
|
|
28
|
+
this.to = { ...to };
|
|
29
|
+
this.colour = options.colour ?? 0xffffff;
|
|
30
|
+
this.texture = options.texture;
|
|
31
|
+
this.thickness = options.width ?? 2;
|
|
32
|
+
this.duration = Math.max(1e-6, options.duration ?? 0.2);
|
|
33
|
+
if (this.texture) {
|
|
34
|
+
this.body = new TilingSprite({ texture: this.texture, width: 1, height: this.thickness });
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.body = new Graphics();
|
|
38
|
+
}
|
|
39
|
+
if (options.additive ?? true)
|
|
40
|
+
this.body.blendMode = 'add';
|
|
41
|
+
this.addChild(this.body);
|
|
42
|
+
this.redraw();
|
|
43
|
+
}
|
|
44
|
+
/** 0 at launch, 1 at duration end */
|
|
45
|
+
get progress() {
|
|
46
|
+
return Math.min(1, this.elapsed / this.duration);
|
|
47
|
+
}
|
|
48
|
+
get done() {
|
|
49
|
+
return this.expired;
|
|
50
|
+
}
|
|
51
|
+
/** moves either endpoint, for a beam tracking two points that are themselves moving */
|
|
52
|
+
retarget(from, to) {
|
|
53
|
+
if (from)
|
|
54
|
+
this.from = { ...from };
|
|
55
|
+
if (to)
|
|
56
|
+
this.to = { ...to };
|
|
57
|
+
this.redraw();
|
|
58
|
+
}
|
|
59
|
+
/** @returns true the instant `duration` elapses, so a caller can remove the beam exactly once */
|
|
60
|
+
update(dt) {
|
|
61
|
+
if (this.expired)
|
|
62
|
+
return false;
|
|
63
|
+
this.elapsed += dt;
|
|
64
|
+
this.alpha = 1 - this.progress;
|
|
65
|
+
if (this.elapsed >= this.duration) {
|
|
66
|
+
this.expired = true;
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
destroy() {
|
|
72
|
+
this.removeChild(this.body);
|
|
73
|
+
this.body.destroy();
|
|
74
|
+
super.destroy();
|
|
75
|
+
}
|
|
76
|
+
redraw() {
|
|
77
|
+
const dx = this.to.x - this.from.x;
|
|
78
|
+
const dy = this.to.y - this.from.y;
|
|
79
|
+
const length = Math.hypot(dx, dy);
|
|
80
|
+
this.position.set(this.from.x, this.from.y);
|
|
81
|
+
this.rotation = length > 0 ? Math.atan2(dy, dx) : 0;
|
|
82
|
+
if (this.body instanceof TilingSprite) {
|
|
83
|
+
this.body.width = length;
|
|
84
|
+
this.body.height = this.thickness;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const line = this.body;
|
|
88
|
+
line.clear();
|
|
89
|
+
line.moveTo(0, 0);
|
|
90
|
+
line.lineTo(length, 0);
|
|
91
|
+
line.stroke({ width: this.thickness, color: this.colour });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Owns the beams a game has flashing: one `add` per ray, one `update(dt)` fading
|
|
97
|
+
* them all and forgetting the finished ones, and no bookkeeping left to the caller.
|
|
98
|
+
* Beams are parented here and destroyed with their beam; z-order stays the caller's.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* import { Beams } from '@datamoc/mw_games/two-d/render';
|
|
103
|
+
* import type { Container2D } from '@datamoc/mw_games/two-d/render';
|
|
104
|
+
*
|
|
105
|
+
* declare const layer: Container2D;
|
|
106
|
+
*
|
|
107
|
+
* const beams = new Beams();
|
|
108
|
+
* layer.addChild(beams);
|
|
109
|
+
*
|
|
110
|
+
* beams.add({ x: 0, y: 0 }, { x: 100, y: 0 }, { colour: 0x88ccff });
|
|
111
|
+
* beams.update(1 / 60);
|
|
112
|
+
* console.log(beams.count); // 1 - still fading
|
|
113
|
+
* beams.clear();
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export class Beams extends Container {
|
|
117
|
+
constructor() {
|
|
118
|
+
super(...arguments);
|
|
119
|
+
this.live = [];
|
|
120
|
+
}
|
|
121
|
+
/** flashes a beam between two points; it fades on `update` and removes itself at duration end */
|
|
122
|
+
add(from, to, options) {
|
|
123
|
+
const beam = new Beam(from, to, options);
|
|
124
|
+
this.addChild(beam);
|
|
125
|
+
this.live.push(beam);
|
|
126
|
+
return beam;
|
|
127
|
+
}
|
|
128
|
+
/** fades every live beam, then forgets and destroys the finished ones */
|
|
129
|
+
update(dt) {
|
|
130
|
+
for (let i = this.live.length - 1; i >= 0; i--) {
|
|
131
|
+
if (this.live[i].update(dt)) {
|
|
132
|
+
const [beam] = this.live.splice(i, 1);
|
|
133
|
+
this.removeChild(beam);
|
|
134
|
+
beam.destroy();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** how many beams are still fading */
|
|
139
|
+
get count() {
|
|
140
|
+
return this.live.length;
|
|
141
|
+
}
|
|
142
|
+
/** drops every live beam at once - a scene change, say */
|
|
143
|
+
clear() {
|
|
144
|
+
for (const beam of this.live.splice(0)) {
|
|
145
|
+
this.removeChild(beam);
|
|
146
|
+
beam.destroy();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
destroy() {
|
|
150
|
+
this.clear();
|
|
151
|
+
super.destroy();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=Beam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Beam.js","sourceRoot":"","sources":["../../../src/two-d/render/Beam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AAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,yEAAyE;IACzE,MAAM,CAAC,EAAU;QAChB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAChD,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBACtC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACvB,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,CAAC;QACF,CAAC;IACF,CAAC;IAED,sCAAsC;IACtC,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,0DAA0D;IAC1D,KAAK;QACJ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Container } from 'pixi.js';
|
|
2
|
+
import { Projectile, type ProjectileOptions, type ProjectilePoint } from './Projectile.ts';
|
|
3
|
+
import type { Texture2D } from './Types2D.ts';
|
|
4
|
+
/** what a flight moves: position required, presentation optional and applied only when present */
|
|
5
|
+
export interface FlightSprite {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
rotation?: number;
|
|
9
|
+
alpha?: number;
|
|
10
|
+
tint?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface FlightOptions extends ProjectileOptions {
|
|
13
|
+
/** set once at launch, when the sprite takes a tint */
|
|
14
|
+
tint?: number;
|
|
15
|
+
/** radians per second added to the sprite's rotation while flying */
|
|
16
|
+
spin?: number;
|
|
17
|
+
/** seconds the sprite fades 0 to 1 from launch; 0 or omitted means no fade */
|
|
18
|
+
fadeIn?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Dispatched once, when this flight arrives - never on `cancel()` or `clear()`,
|
|
21
|
+
* and after the flight has left the list, so an arrival that launches another
|
|
22
|
+
* flight cannot disturb the iteration it arrived in.
|
|
23
|
+
*/
|
|
24
|
+
onArrive?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface FlightHandle {
|
|
27
|
+
/** the flight's own tween: `progress`, `frame`, `done` */
|
|
28
|
+
readonly projectile: Projectile;
|
|
29
|
+
/** whether the flight has arrived */
|
|
30
|
+
readonly done: boolean;
|
|
31
|
+
/** forgets the flight without dispatching `onArrive`; a manager-built sprite is destroyed */
|
|
32
|
+
cancel(): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Owns the projectile flights a game has in the air: one `add` per shot, one
|
|
36
|
+
* `update(dt)` driving them all, `onArrive` dispatched exactly once per arrival,
|
|
37
|
+
* and no bookkeeping left to the caller.
|
|
38
|
+
*
|
|
39
|
+
* Ownership follows who made the sprite. A sprite you pass stays yours - the
|
|
40
|
+
* manager positions it but never parents or destroys it, so layering and scene
|
|
41
|
+
* teardown stay the caller's. A texture builds a manager sprite instead: parented
|
|
42
|
+
* here and destroyed on arrival, cancel or clear. Destroying the `Flights` node
|
|
43
|
+
* itself clears first, so manager-built sprites never outlive it.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { Flights } from '@datamoc/mw_games/two-d/render';
|
|
48
|
+
* import type { Container2D } from '@datamoc/mw_games/two-d/render';
|
|
49
|
+
*
|
|
50
|
+
* declare const layer: Container2D;
|
|
51
|
+
* declare const bolt: { x: number; y: number };
|
|
52
|
+
*
|
|
53
|
+
* const flights = new Flights();
|
|
54
|
+
* layer.addChild(flights);
|
|
55
|
+
*
|
|
56
|
+
* const flight = flights.add(bolt, { x: 0, y: 0 }, { x: 200, y: 0 }, {
|
|
57
|
+
* speed: 400,
|
|
58
|
+
* onArrive: () => console.log('hit'),
|
|
59
|
+
* });
|
|
60
|
+
* flights.update(1 / 60);
|
|
61
|
+
* console.log(flights.count, flight.done); // 1 false - still flying
|
|
62
|
+
* flight.cancel();
|
|
63
|
+
* flights.clear();
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare class Flights extends Container {
|
|
67
|
+
private readonly live;
|
|
68
|
+
add(sprite: FlightSprite, from: ProjectilePoint, to: ProjectilePoint, options?: FlightOptions): FlightHandle;
|
|
69
|
+
add(texture: Texture2D, from: ProjectilePoint, to: ProjectilePoint, options?: FlightOptions): FlightHandle;
|
|
70
|
+
/** drives every live flight, then forgets the arrived ones (arrival first, callback after) */
|
|
71
|
+
update(dt: number): void;
|
|
72
|
+
/** how many flights are still in the air */
|
|
73
|
+
get count(): number;
|
|
74
|
+
/** drops every live flight at once without dispatching arrivals - a scene change, say */
|
|
75
|
+
clear(): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
private release;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=Flights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flights.d.ts","sourceRoot":"","sources":["../../../src/two-d/render/Flights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA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AI,IAAI,CAGvB;IAED,OAAO,CAAC,OAAO;CAKf"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Container, Sprite, Texture } from 'pixi.js';
|
|
2
|
+
import { Projectile } from './Projectile.js';
|
|
3
|
+
/**
|
|
4
|
+
* Owns the projectile flights a game has in the air: one `add` per shot, one
|
|
5
|
+
* `update(dt)` driving them all, `onArrive` dispatched exactly once per arrival,
|
|
6
|
+
* and no bookkeeping left to the caller.
|
|
7
|
+
*
|
|
8
|
+
* Ownership follows who made the sprite. A sprite you pass stays yours - the
|
|
9
|
+
* manager positions it but never parents or destroys it, so layering and scene
|
|
10
|
+
* teardown stay the caller's. A texture builds a manager sprite instead: parented
|
|
11
|
+
* here and destroyed on arrival, cancel or clear. Destroying the `Flights` node
|
|
12
|
+
* itself clears first, so manager-built sprites never outlive it.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { Flights } from '@datamoc/mw_games/two-d/render';
|
|
17
|
+
* import type { Container2D } from '@datamoc/mw_games/two-d/render';
|
|
18
|
+
*
|
|
19
|
+
* declare const layer: Container2D;
|
|
20
|
+
* declare const bolt: { x: number; y: number };
|
|
21
|
+
*
|
|
22
|
+
* const flights = new Flights();
|
|
23
|
+
* layer.addChild(flights);
|
|
24
|
+
*
|
|
25
|
+
* const flight = flights.add(bolt, { x: 0, y: 0 }, { x: 200, y: 0 }, {
|
|
26
|
+
* speed: 400,
|
|
27
|
+
* onArrive: () => console.log('hit'),
|
|
28
|
+
* });
|
|
29
|
+
* flights.update(1 / 60);
|
|
30
|
+
* console.log(flights.count, flight.done); // 1 false - still flying
|
|
31
|
+
* flight.cancel();
|
|
32
|
+
* flights.clear();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export class Flights extends Container {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.live = [];
|
|
39
|
+
}
|
|
40
|
+
add(art, from, to, options = {}) {
|
|
41
|
+
let sprite;
|
|
42
|
+
let built;
|
|
43
|
+
if (art instanceof Texture) {
|
|
44
|
+
built = new Sprite(art);
|
|
45
|
+
this.addChild(built);
|
|
46
|
+
sprite = built;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
sprite = art;
|
|
50
|
+
}
|
|
51
|
+
if (options.tint !== undefined && typeof sprite.tint === 'number')
|
|
52
|
+
sprite.tint = options.tint;
|
|
53
|
+
const fadeIn = options.fadeIn ?? 0;
|
|
54
|
+
const baseAlpha = typeof sprite.alpha === 'number' ? sprite.alpha : 1;
|
|
55
|
+
if (fadeIn > 0)
|
|
56
|
+
sprite.alpha = 0;
|
|
57
|
+
const flight = {
|
|
58
|
+
projectile: new Projectile(sprite, from, to, options),
|
|
59
|
+
sprite,
|
|
60
|
+
built,
|
|
61
|
+
onArrive: options.onArrive,
|
|
62
|
+
spin: options.spin,
|
|
63
|
+
fadeIn,
|
|
64
|
+
baseAlpha,
|
|
65
|
+
elapsed: 0,
|
|
66
|
+
};
|
|
67
|
+
this.live.push(flight);
|
|
68
|
+
return {
|
|
69
|
+
projectile: flight.projectile,
|
|
70
|
+
get done() {
|
|
71
|
+
return flight.projectile.done;
|
|
72
|
+
},
|
|
73
|
+
cancel: () => {
|
|
74
|
+
const index = this.live.indexOf(flight);
|
|
75
|
+
if (index === -1)
|
|
76
|
+
return;
|
|
77
|
+
this.live.splice(index, 1);
|
|
78
|
+
this.release(flight);
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** drives every live flight, then forgets the arrived ones (arrival first, callback after) */
|
|
83
|
+
update(dt) {
|
|
84
|
+
for (let i = this.live.length - 1; i >= 0; i--) {
|
|
85
|
+
const flight = this.live[i];
|
|
86
|
+
flight.elapsed += dt;
|
|
87
|
+
if (flight.spin !== undefined) {
|
|
88
|
+
flight.sprite.rotation = (flight.sprite.rotation ?? 0) + flight.spin * dt;
|
|
89
|
+
}
|
|
90
|
+
if (flight.fadeIn > 0) {
|
|
91
|
+
flight.sprite.alpha = flight.baseAlpha * Math.min(1, flight.elapsed / flight.fadeIn);
|
|
92
|
+
}
|
|
93
|
+
if (flight.projectile.update(dt)) {
|
|
94
|
+
this.live.splice(i, 1);
|
|
95
|
+
this.release(flight);
|
|
96
|
+
flight.onArrive?.();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** how many flights are still in the air */
|
|
101
|
+
get count() {
|
|
102
|
+
return this.live.length;
|
|
103
|
+
}
|
|
104
|
+
/** drops every live flight at once without dispatching arrivals - a scene change, say */
|
|
105
|
+
clear() {
|
|
106
|
+
for (const flight of this.live.splice(0))
|
|
107
|
+
this.release(flight);
|
|
108
|
+
}
|
|
109
|
+
destroy() {
|
|
110
|
+
this.clear();
|
|
111
|
+
super.destroy();
|
|
112
|
+
}
|
|
113
|
+
release(flight) {
|
|
114
|
+
if (!flight.built)
|
|
115
|
+
return;
|
|
116
|
+
this.removeChild(flight.built);
|
|
117
|
+
flight.built.destroy();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=Flights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flights.js","sourceRoot":"","sources":["../../../src/two-d/render/Flights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,UAAU,EAAgD,MAAM,iBAAiB,CAAC;AA+C3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAAtC;;QACkB,SAAI,GAAiB,EAAE,CAAC;IA0F1C,CAAC;IAtFA,GAAG,CACF,GAA6B,EAC7B,IAAqB,EACrB,EAAmB,EACnB,OAAO,GAAkB,EAAE;QAE3B,IAAI,MAAoB,CAAC;QACzB,IAAI,KAAyB,CAAC;QAC9B,IAAI,GAAG,YAAY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AAyF;IACzF,KAAK;QACJ,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,CAAC;IAEQ,OAAO;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEO,OAAO,CAAC,MAAkB;QACjC,IAAI,CAAC,MAAM,CAAC,KAAK;YAAE,OAAO;QAC1B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD"}
|
|
@@ -104,6 +104,24 @@ export interface ParticleEmitterOptions {
|
|
|
104
104
|
*/
|
|
105
105
|
tint?: ParticleRange;
|
|
106
106
|
}
|
|
107
|
+
/** what an attached emitter follows: a display object, or a thunk reading live position */
|
|
108
|
+
export type FollowTarget = Container | (() => {
|
|
109
|
+
x: number;
|
|
110
|
+
y: number;
|
|
111
|
+
});
|
|
112
|
+
/** options for {@link ParticleEmitter.attach} */
|
|
113
|
+
export interface FollowOptions {
|
|
114
|
+
/** added to the target position on every sync */
|
|
115
|
+
offsetX?: number;
|
|
116
|
+
offsetY?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Consulted on every update tick; a false return pauses emission while the target
|
|
119
|
+
* is off-screen or paused, without consumer bookkeeping. Particles already alive
|
|
120
|
+
* still finish their lives, and an explicit `burst()` always fires - the callback
|
|
121
|
+
* gates the tick, not the call.
|
|
122
|
+
*/
|
|
123
|
+
enabled?: () => boolean;
|
|
124
|
+
}
|
|
107
125
|
/**
|
|
108
126
|
* A pooled particle emitter: sparks off a sword hit, dust under a footstep, rain over a map.
|
|
109
127
|
*
|
|
@@ -160,6 +178,10 @@ export declare class ParticleEmitter extends Container {
|
|
|
160
178
|
/** where in local space births happen, or null for a single point at the origin */
|
|
161
179
|
private readonly spawnArea;
|
|
162
180
|
private emitting;
|
|
181
|
+
private followTarget;
|
|
182
|
+
private followOffsetX;
|
|
183
|
+
private followOffsetY;
|
|
184
|
+
private followEnabled;
|
|
163
185
|
/** where the next pool search starts, so reuse stays O(1) amortised rather than O(pool) */
|
|
164
186
|
private poolCursor;
|
|
165
187
|
/** fractional particles owed from previous frames, so a low rate still emits accurately */
|
|
@@ -169,6 +191,32 @@ export declare class ParticleEmitter extends Container {
|
|
|
169
191
|
start(): void;
|
|
170
192
|
/** stops emitting; particles already alive still finish their lives */
|
|
171
193
|
stop(): void;
|
|
194
|
+
/**
|
|
195
|
+
* Follows `target`, repositioning on every update tick and every `burst()`, plus
|
|
196
|
+
* once right now so the position is fresh before the first tick. A second `attach`
|
|
197
|
+
* replaces the first; `detach()` stops following and keeps the last position. A
|
|
198
|
+
* destroyed `Container` target cannot move again, so it auto-detaches (thunk
|
|
199
|
+
* targets are read unconditionally - their liveness is the caller's).
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* import { ParticleEmitter } from '@datamoc/mw_games/two-d/render';
|
|
204
|
+
*
|
|
205
|
+
* const aura = new ParticleEmitter({ rate: 20 });
|
|
206
|
+
* const hero = { x: 100, y: 200 };
|
|
207
|
+
* aura.attach(() => hero, { offsetY: -10 });
|
|
208
|
+
* aura.start();
|
|
209
|
+
* aura.update(1 / 60);
|
|
210
|
+
* aura.detach();
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
attach(target: FollowTarget, options?: FollowOptions): void;
|
|
214
|
+
/** stops following; the emitter keeps its last position and its emitting state */
|
|
215
|
+
detach(): void;
|
|
216
|
+
/** the current follow target, or null when detached */
|
|
217
|
+
get attachedTo(): FollowTarget | null;
|
|
218
|
+
private syncFollow;
|
|
219
|
+
private followEmissionAllowed;
|
|
172
220
|
get isEmitting(): boolean;
|
|
173
221
|
/** how many particles are alive right now */
|
|
174
222
|
get activeCount(): number;
|
|
@@ -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