@gamedevland/engine 0.0.5 → 0.0.7
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/LICENSE +16 -18
- package/README.md +20 -3
- package/dist/sdk.d.ts +20 -0
- package/dist/sdk.js +119 -76
- package/package.json +11 -2
package/LICENSE
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 Gamedev Land
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- remove copyright, license, or package identity notices;
|
|
18
|
-
- use the package name, author name, or repository identity to imply endorsement without permission.
|
|
19
|
-
|
|
20
|
-
The SDK is provided "as is", without warranty of any kind, express or implied, including but not limited
|
|
21
|
-
to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event
|
|
22
|
-
shall the authors or copyright holders be liable for any claim, damages, or other liability arising from
|
|
23
|
-
the SDK or its use.
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gamedevland/engine
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Open-source TypeScript HTML5 game engine SDK for Gamedev Land projects.
|
|
4
4
|
|
|
5
5
|
The npm package intentionally ships a compact public distribution:
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ The npm package intentionally ships a compact public distribution:
|
|
|
8
8
|
- `dist/sdk.d.ts` - bundled TypeScript declarations
|
|
9
9
|
- `README.md`, `LICENSE`, and `package.json`
|
|
10
10
|
|
|
11
|
-
Source files are
|
|
11
|
+
Source files are available in [the SDK repository](https://github.com/gamedevland/sdk/tree/main/packages/engine/src); the npm archive contains the compiled distribution.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -46,6 +46,21 @@ Layout nodes expose `getLocalBounds()` for renderer-independent local geometry q
|
|
|
46
46
|
|
|
47
47
|
## TypeScript
|
|
48
48
|
|
|
49
|
+
### Runtime activity and pointer metadata (0.0.6)
|
|
50
|
+
|
|
51
|
+
Version 0.0.7 makes spawned prefab disposal idempotent and removes the logical
|
|
52
|
+
child registration as well as the rendered node. Disposed local IDs can be reused
|
|
53
|
+
without retaining dead nodes in their parent's registry.
|
|
54
|
+
|
|
55
|
+
`SceneRuntime.activity.getSnapshot()` exposes `pageInactive`, `effectivePaused` and
|
|
56
|
+
the current immutable pause `reasons`. `activity.subscribe(listener)` returns a
|
|
57
|
+
disposer and fires whenever the reason set changes, even while the scene ticker
|
|
58
|
+
is paused. Read the initial snapshot explicitly after subscribing. The callback
|
|
59
|
+
runs before the effective pause state is applied, allowing synchronous saves.
|
|
60
|
+
The facade does not pause menus; consumers can pause their world simulation while
|
|
61
|
+
leaving panel input active. Native pointer events expose optional `button`,
|
|
62
|
+
`buttons`, and `isPrimary`; synthetic/wheel events may omit them.
|
|
63
|
+
|
|
49
64
|
The package provides `dist/sdk.d.ts` and is designed for TypeScript consumers using modern ESM tooling.
|
|
50
65
|
|
|
51
66
|
Recommended compiler settings:
|
|
@@ -68,4 +83,6 @@ type declarations may conflict with newer TypeScript DOM library declarations in
|
|
|
68
83
|
|
|
69
84
|
## License
|
|
70
85
|
|
|
71
|
-
|
|
86
|
+
MIT. See [LICENSE](./LICENSE). Source code and contributions: [gamedevland/sdk](https://github.com/gamedevland/sdk).
|
|
87
|
+
|
|
88
|
+
Earlier npm releases retain the license included in their respective archives. Third-party dependencies retain their own licenses.
|
package/dist/sdk.d.ts
CHANGED
|
@@ -1081,6 +1081,10 @@ export interface InputEventBase {
|
|
|
1081
1081
|
time: number;
|
|
1082
1082
|
pointerId: number;
|
|
1083
1083
|
pointerType: PointerType;
|
|
1084
|
+
/** Native pointer metadata; absent on synthetic and wheel events. */
|
|
1085
|
+
button?: number;
|
|
1086
|
+
buttons?: number;
|
|
1087
|
+
isPrimary?: boolean;
|
|
1084
1088
|
screen: {
|
|
1085
1089
|
x: number;
|
|
1086
1090
|
y: number;
|
|
@@ -1640,6 +1644,20 @@ export declare abstract class BaseComponent<TNode extends NodeBase = NodeBase> {
|
|
|
1640
1644
|
completeDetach(): Promise<void>;
|
|
1641
1645
|
protected finalizeDetachState(): void;
|
|
1642
1646
|
}
|
|
1647
|
+
export type RuntimePauseReason = "pageInactive" | "manual" | "platform" | "adBreak";
|
|
1648
|
+
export interface RuntimeActivitySnapshot {
|
|
1649
|
+
readonly pageInactive: boolean;
|
|
1650
|
+
readonly effectivePaused: boolean;
|
|
1651
|
+
readonly reasons: readonly RuntimePauseReason[];
|
|
1652
|
+
}
|
|
1653
|
+
/** Observable activity independent of the paused scene ticker. */
|
|
1654
|
+
export declare class RuntimeActivity {
|
|
1655
|
+
private snapshot;
|
|
1656
|
+
private readonly listeners;
|
|
1657
|
+
getSnapshot(): RuntimeActivitySnapshot;
|
|
1658
|
+
subscribe(listener: (snapshot: RuntimeActivitySnapshot) => void): () => void;
|
|
1659
|
+
update(reasons: readonly RuntimePauseReason[]): void;
|
|
1660
|
+
}
|
|
1643
1661
|
export declare class DiContainer implements DiContainerInterface {
|
|
1644
1662
|
private readonly parent;
|
|
1645
1663
|
private readonly providers;
|
|
@@ -2593,6 +2611,7 @@ export declare class GsapTweenManager implements TweenManager {
|
|
|
2593
2611
|
* Scenes should depend on this contract instead of concrete Engine internals.
|
|
2594
2612
|
*/
|
|
2595
2613
|
export interface SceneRuntime {
|
|
2614
|
+
readonly activity: RuntimeActivity;
|
|
2596
2615
|
readonly app: Application;
|
|
2597
2616
|
readonly audio: AudioManager;
|
|
2598
2617
|
readonly assets: AssetManager;
|
|
@@ -4164,6 +4183,7 @@ export declare class Engine implements SceneRuntime, CommandRuntime, InputRuntim
|
|
|
4164
4183
|
bootstrapConfigBundles(bundleNames: readonly string[]): Promise<void>;
|
|
4165
4184
|
private resolveActiveSceneFSM;
|
|
4166
4185
|
setPaused(paused: boolean): void;
|
|
4186
|
+
readonly activity: RuntimeActivity;
|
|
4167
4187
|
isPaused(): boolean;
|
|
4168
4188
|
private handlePlatformPauseRequested;
|
|
4169
4189
|
private handlePlatformResumeRequested;
|
package/dist/sdk.js
CHANGED
|
@@ -228,7 +228,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
228
228
|
static isKnown(e) {
|
|
229
229
|
return gt.Known.has(e);
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, iN = class v_ {
|
|
232
232
|
static isEngineError(e) {
|
|
233
233
|
return e instanceof _c;
|
|
234
234
|
}
|
|
@@ -747,7 +747,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
747
747
|
}
|
|
748
748
|
];
|
|
749
749
|
}
|
|
750
|
-
},
|
|
750
|
+
}, sN = class {
|
|
751
751
|
input;
|
|
752
752
|
idStrategy;
|
|
753
753
|
policy;
|
|
@@ -3043,7 +3043,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3043
3043
|
}
|
|
3044
3044
|
});
|
|
3045
3045
|
}
|
|
3046
|
-
},
|
|
3046
|
+
}, rN = class {
|
|
3047
3047
|
configStore;
|
|
3048
3048
|
resolveDecoder;
|
|
3049
3049
|
constructor(t, e) {
|
|
@@ -3055,7 +3055,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3055
3055
|
getByEntry(t) {
|
|
3056
3056
|
return this.configStore.get(t.fileId, t.decoder);
|
|
3057
3057
|
}
|
|
3058
|
-
},
|
|
3058
|
+
}, nN = class Tu {
|
|
3059
3059
|
fileId;
|
|
3060
3060
|
decoder;
|
|
3061
3061
|
static FILE_ID_PATTERN = /^json\/configs\/.+\.json$/;
|
|
@@ -3491,7 +3491,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3491
3491
|
}
|
|
3492
3492
|
});
|
|
3493
3493
|
}
|
|
3494
|
-
},
|
|
3494
|
+
}, aN = class {
|
|
3495
3495
|
coordinator = Cu.shared();
|
|
3496
3496
|
getItem(t) {
|
|
3497
3497
|
return this.coordinator.getItem(t);
|
|
@@ -3502,14 +3502,14 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3502
3502
|
removeItem(t) {
|
|
3503
3503
|
this.coordinator.removeItem(t);
|
|
3504
3504
|
}
|
|
3505
|
-
},
|
|
3505
|
+
}, oN = class {
|
|
3506
3506
|
fileId;
|
|
3507
3507
|
key;
|
|
3508
3508
|
decoder;
|
|
3509
3509
|
constructor(t, e, i) {
|
|
3510
3510
|
this.fileId = t, this.key = e, this.decoder = i;
|
|
3511
3511
|
}
|
|
3512
|
-
},
|
|
3512
|
+
}, lN = class S_ {
|
|
3513
3513
|
configStore;
|
|
3514
3514
|
static SettingsDecoder = I.record();
|
|
3515
3515
|
constructor(e) {
|
|
@@ -3535,7 +3535,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3535
3535
|
});
|
|
3536
3536
|
}
|
|
3537
3537
|
}
|
|
3538
|
-
},
|
|
3538
|
+
}, cN = class {
|
|
3539
3539
|
namespace;
|
|
3540
3540
|
constructor(t) {
|
|
3541
3541
|
if (this.namespace = t, !t || t.trim().length === 0) throw D.invalidInput({
|
|
@@ -3554,7 +3554,7 @@ var dP = Object.create, Vl = Object.defineProperty, fP = Object.getOwnPropertyDe
|
|
|
3554
3554
|
});
|
|
3555
3555
|
return `${this.namespace}:${t}`;
|
|
3556
3556
|
}
|
|
3557
|
-
},
|
|
3557
|
+
}, hN = class {
|
|
3558
3558
|
options;
|
|
3559
3559
|
fullKey;
|
|
3560
3560
|
sourceLabel;
|
|
@@ -3757,7 +3757,7 @@ function sA(t, e) {
|
|
|
3757
3757
|
source: "system"
|
|
3758
3758
|
});
|
|
3759
3759
|
}
|
|
3760
|
-
function
|
|
3760
|
+
function uN(t, e, i, s = "transient") {
|
|
3761
3761
|
t.register({
|
|
3762
3762
|
token: Te.element(e),
|
|
3763
3763
|
useFactory: () => i,
|
|
@@ -27169,7 +27169,7 @@ var q2 = class {
|
|
|
27169
27169
|
y: i.scale.y ?? 1
|
|
27170
27170
|
})), i?.rotation !== void 0 && e.setRotation(i.rotation), i?.angle !== void 0 && e.setAngle(i.angle), i?.alpha !== void 0 && e.setAlpha(i.alpha), i?.visible !== void 0 && e.setVisible(i.visible), i?.zIndex !== void 0 && e.setZIndex(i.zIndex);
|
|
27171
27171
|
}
|
|
27172
|
-
},
|
|
27172
|
+
}, dN = class ua extends nA {
|
|
27173
27173
|
static SPACES = ["local", "world"];
|
|
27174
27174
|
static CONFIG = I.object({
|
|
27175
27175
|
preset: I.optional(I.record()),
|
|
@@ -27650,7 +27650,7 @@ var q2 = class {
|
|
|
27650
27650
|
source: e.source ?? "game"
|
|
27651
27651
|
}));
|
|
27652
27652
|
}
|
|
27653
|
-
},
|
|
27653
|
+
}, fN = class {
|
|
27654
27654
|
finalBuild() {
|
|
27655
27655
|
return {
|
|
27656
27656
|
globalProviders: this.createGlobalDefinition().finalBuildProviders(),
|
|
@@ -27737,7 +27737,7 @@ var q2 = class {
|
|
|
27737
27737
|
valueGroup() {
|
|
27738
27738
|
return this.group;
|
|
27739
27739
|
}
|
|
27740
|
-
},
|
|
27740
|
+
}, pN = class {
|
|
27741
27741
|
finalBuildProviders() {
|
|
27742
27742
|
const t = new dT(), e = new hT(), i = new cT(), s = new pT();
|
|
27743
27743
|
return this.registerElements(t), this.registerComponents(e), this.registerCommands(i), this.registerServices(s), new sD({
|
|
@@ -27807,7 +27807,7 @@ var q2 = class {
|
|
|
27807
27807
|
}
|
|
27808
27808
|
return String(t);
|
|
27809
27809
|
}
|
|
27810
|
-
},
|
|
27810
|
+
}, mN = class {
|
|
27811
27811
|
finalBuild() {
|
|
27812
27812
|
const t = this.getSceneKey().trim();
|
|
27813
27813
|
if (!t) throw D.invalidInput({
|
|
@@ -27849,7 +27849,7 @@ var q2 = class {
|
|
|
27849
27849
|
driftXPerSecond: I.number({ defaultValue: 32 }),
|
|
27850
27850
|
driftYPerSecond: I.number({ defaultValue: 24 }),
|
|
27851
27851
|
enabled: I.boolean({ defaultValue: !0 })
|
|
27852
|
-
}),
|
|
27852
|
+
}), gN = class extends jc {
|
|
27853
27853
|
configDecoder = nD;
|
|
27854
27854
|
noiseSprite;
|
|
27855
27855
|
filter;
|
|
@@ -27889,7 +27889,7 @@ var q2 = class {
|
|
|
27889
27889
|
const t = this.node.view.filters;
|
|
27890
27890
|
return t === void 0 ? [] : t instanceof eo ? [t] : Array.from(t);
|
|
27891
27891
|
}
|
|
27892
|
-
},
|
|
27892
|
+
}, yN = class mT extends jc {
|
|
27893
27893
|
static CONFIG = I.object({
|
|
27894
27894
|
preset: I.record(),
|
|
27895
27895
|
autoStart: I.boolean({ defaultValue: !0 }),
|
|
@@ -28047,7 +28047,7 @@ var q2 = class {
|
|
|
28047
28047
|
land: I.optional(Dv),
|
|
28048
28048
|
port: I.optional(Dv)
|
|
28049
28049
|
}))
|
|
28050
|
-
}),
|
|
28050
|
+
}), vN = class extends jc {
|
|
28051
28051
|
configDecoder = pD;
|
|
28052
28052
|
lastSnapshot;
|
|
28053
28053
|
unsubscribeScreen;
|
|
@@ -28276,14 +28276,14 @@ var q2 = class {
|
|
|
28276
28276
|
clamp(t, e, i) {
|
|
28277
28277
|
return Math.min(i, Math.max(e, t));
|
|
28278
28278
|
}
|
|
28279
|
-
},
|
|
28279
|
+
}, _N = class bT extends gr {
|
|
28280
28280
|
constructor() {
|
|
28281
28281
|
super(new Ke());
|
|
28282
28282
|
}
|
|
28283
28283
|
static create(e, i, s) {
|
|
28284
28284
|
return new bT();
|
|
28285
28285
|
}
|
|
28286
|
-
},
|
|
28286
|
+
}, xN = class ST extends gr {
|
|
28287
28287
|
graphics;
|
|
28288
28288
|
constructor(e) {
|
|
28289
28289
|
super(e), this.graphics = e, this.setKind("graphics");
|
|
@@ -28306,7 +28306,7 @@ var q2 = class {
|
|
|
28306
28306
|
min: 0
|
|
28307
28307
|
}),
|
|
28308
28308
|
autoUpdate: I.boolean({ defaultValue: !0 })
|
|
28309
|
-
}),
|
|
28309
|
+
}), bN = class Lr extends gr {
|
|
28310
28310
|
rope;
|
|
28311
28311
|
points;
|
|
28312
28312
|
offsets;
|
|
@@ -28559,7 +28559,7 @@ var q2 = class {
|
|
|
28559
28559
|
details: { method: "TexturedRope.resolveOwner" }
|
|
28560
28560
|
});
|
|
28561
28561
|
}
|
|
28562
|
-
},
|
|
28562
|
+
}, SN = class wT extends gr {
|
|
28563
28563
|
text;
|
|
28564
28564
|
constructor(e) {
|
|
28565
28565
|
super(e), this.text = e, this.setKind("text");
|
|
@@ -30968,6 +30968,9 @@ var q2 = class {
|
|
|
30968
30968
|
const r = {
|
|
30969
30969
|
time: e,
|
|
30970
30970
|
pointerId: t.pointerId,
|
|
30971
|
+
button: t.button,
|
|
30972
|
+
buttons: t.buttons,
|
|
30973
|
+
isPrimary: t.isPrimary,
|
|
30971
30974
|
pointerType: this.toPointerType(t.pointerType),
|
|
30972
30975
|
screen: {
|
|
30973
30976
|
x: t.clientX,
|
|
@@ -35548,7 +35551,7 @@ var eF = class {
|
|
|
35548
35551
|
if (e.length === 0) throw Pe.worldIdRequired(`${s}.${i}`);
|
|
35549
35552
|
return e;
|
|
35550
35553
|
}
|
|
35551
|
-
},
|
|
35554
|
+
}, wN = class yt {
|
|
35552
35555
|
manager;
|
|
35553
35556
|
config;
|
|
35554
35557
|
static SOURCE_NAME = "PhysicsSceneService";
|
|
@@ -35656,7 +35659,7 @@ var eF = class {
|
|
|
35656
35659
|
static getSupportedList() {
|
|
35657
35660
|
return [...Gi.SUPPORTED];
|
|
35658
35661
|
}
|
|
35659
|
-
},
|
|
35662
|
+
}, TN = class {
|
|
35660
35663
|
static FILE_ID = "json/configs/common/app/platforms.json";
|
|
35661
35664
|
static getRequiredGameDistributionGameId(t, e) {
|
|
35662
35665
|
const i = t.gamedistribution?.gameId;
|
|
@@ -36518,11 +36521,15 @@ var eF = class {
|
|
|
36518
36521
|
});
|
|
36519
36522
|
this.activator.activateTree(h);
|
|
36520
36523
|
const u = h.object;
|
|
36521
|
-
|
|
36524
|
+
t.parent.addChild(t.localId, u), t.parent.view.addChild(u.view);
|
|
36525
|
+
let c = !1;
|
|
36526
|
+
return {
|
|
36522
36527
|
node: u,
|
|
36523
36528
|
dispose: async () => {
|
|
36524
|
-
|
|
36525
|
-
c &&
|
|
36529
|
+
if (c) return;
|
|
36530
|
+
c = !0, t.parent.hasChild(t.localId) && t.parent.getChild(t.localId) === u && t.parent.removeChild(t.localId);
|
|
36531
|
+
const f = u.view.parent;
|
|
36532
|
+
f && f.removeChild(u.view), await u.destroy();
|
|
36526
36533
|
}
|
|
36527
36534
|
};
|
|
36528
36535
|
}
|
|
@@ -39052,7 +39059,7 @@ var UO = function(e, i) {
|
|
|
39052
39059
|
qe.version = xt.version = Mt.version = "3.15.0";
|
|
39053
39060
|
iC = 1;
|
|
39054
39061
|
Gm() && on();
|
|
39055
|
-
var
|
|
39062
|
+
var CN = fe.Power0, PN = fe.Power1, AN = fe.Power2, EN = fe.Power3, MN = fe.Power4, RN = fe.Linear, IN = fe.Quad, BN = fe.Cubic, kN = fe.Quart, DN = fe.Quint, LN = fe.Strong, FN = fe.Elastic, ON = fe.Back, GN = fe.SteppedEase, NN = fe.Bounce, UN = fe.Sine, VN = fe.Expo, HN = fe.Circ, Zv, ds, Qr, Km, js, Qv, Zm, HO = function() {
|
|
39056
39063
|
return typeof window < "u";
|
|
39057
39064
|
}, Zi = {}, zs = 180 / Math.PI, Jr = Math.PI / 180, Br = Math.atan2, Jv = 1e8, Qm = /([A-Z])/g, zO = /(left|right|width|margin|padding|x)/i, WO = /[\s,\(]\S/, Ei = {
|
|
39058
39065
|
autoAlpha: "opacity,visibility",
|
|
@@ -39423,7 +39430,7 @@ Ct("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective
|
|
|
39423
39430
|
Wt.units[t] = "px";
|
|
39424
39431
|
});
|
|
39425
39432
|
Mt.registerPlugin(qC);
|
|
39426
|
-
var Le = Mt.registerPlugin(qC) || Mt,
|
|
39433
|
+
var Le = Mt.registerPlugin(qC) || Mt, zN = Le.core.Tween, uG = /[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi, dG = /(?:(-)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi, fG = /[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi, pG = /(^[#\.][a-z]|[a-y][a-z])/i, mG = Math.PI / 180, gG = 180 / Math.PI, nl = Math.sin, al = Math.cos, ri = Math.abs, $i = Math.sqrt, yG = Math.atan2, sp = 1e8, o_ = function(e) {
|
|
39427
39434
|
return typeof e == "string";
|
|
39428
39435
|
}, XC = function(e) {
|
|
39429
39436
|
return typeof e == "number";
|
|
@@ -40627,10 +40634,41 @@ var qG = class {
|
|
|
40627
40634
|
this.disposed || (this.pageInactivePaused = t, this.recomputePaused());
|
|
40628
40635
|
}
|
|
40629
40636
|
recomputePaused() {
|
|
40630
|
-
const t =
|
|
40631
|
-
t
|
|
40637
|
+
const t = [];
|
|
40638
|
+
this.pageInactivePaused && t.push("pageInactive"), this.manualPaused && t.push("manual"), this.platformPaused && t.push("platform"), this.adBreakPaused && t.push("adBreak"), this.options.onActivityChanged?.(t);
|
|
40639
|
+
const e = this.pageInactivePaused || this.manualPaused || this.adBreakPaused || this.platformPaused;
|
|
40640
|
+
e !== this.paused && (this.paused = e, this.options.onPausedChanged(e));
|
|
40641
|
+
}
|
|
40642
|
+
}, JG = class {
|
|
40643
|
+
snapshot = Object.freeze({
|
|
40644
|
+
pageInactive: !1,
|
|
40645
|
+
effectivePaused: !1,
|
|
40646
|
+
reasons: Object.freeze([])
|
|
40647
|
+
});
|
|
40648
|
+
listeners = /* @__PURE__ */ new Set();
|
|
40649
|
+
getSnapshot() {
|
|
40650
|
+
return this.snapshot;
|
|
40651
|
+
}
|
|
40652
|
+
subscribe(t) {
|
|
40653
|
+
return this.listeners.add(t), () => {
|
|
40654
|
+
this.listeners.delete(t);
|
|
40655
|
+
};
|
|
40656
|
+
}
|
|
40657
|
+
update(t) {
|
|
40658
|
+
if (this.snapshot.reasons.join("|") !== t.join("|")) {
|
|
40659
|
+
this.snapshot = Object.freeze({
|
|
40660
|
+
pageInactive: t.includes("pageInactive"),
|
|
40661
|
+
effectivePaused: t.length > 0,
|
|
40662
|
+
reasons: Object.freeze([...t])
|
|
40663
|
+
});
|
|
40664
|
+
for (const e of [...this.listeners]) try {
|
|
40665
|
+
e(this.snapshot);
|
|
40666
|
+
} catch (i) {
|
|
40667
|
+
console.error("[RuntimeActivity] Listener failed", i);
|
|
40668
|
+
}
|
|
40669
|
+
}
|
|
40632
40670
|
}
|
|
40633
|
-
},
|
|
40671
|
+
}, WN = class Ul {
|
|
40634
40672
|
static RuntimePausedChangedEvent = "ENGINE__RUNTIME_PAUSED_CHANGED";
|
|
40635
40673
|
static EmptySceneParams = Object.freeze({});
|
|
40636
40674
|
app;
|
|
@@ -40692,7 +40730,10 @@ var qG = class {
|
|
|
40692
40730
|
events: this.events,
|
|
40693
40731
|
screen: this.screen,
|
|
40694
40732
|
resolveActiveSceneFSM: this.resolveActiveSceneFSM.bind(this)
|
|
40695
|
-
}), this.runtimeController = new QG({
|
|
40733
|
+
}), this.runtimeController = new QG({
|
|
40734
|
+
onPausedChanged: this.applyPausedState.bind(this),
|
|
40735
|
+
onActivityChanged: (n) => this.activity.update(n)
|
|
40736
|
+
}), this.platform.setAdBreakHooks(new KG((n) => this.runtimeController.setAdBreakPaused(n)).createHooks()), this.platform.setRuntimeHooks({
|
|
40696
40737
|
onPauseRequested: this.handlePlatformPauseRequested.bind(this),
|
|
40697
40738
|
onResumeRequested: this.handlePlatformResumeRequested.bind(this),
|
|
40698
40739
|
onAudioMuteChanged: this.handlePlatformAudioMuteChanged.bind(this)
|
|
@@ -40762,6 +40803,7 @@ var qG = class {
|
|
|
40762
40803
|
setPaused(e) {
|
|
40763
40804
|
this.runtimeController.setManualPaused(e);
|
|
40764
40805
|
}
|
|
40806
|
+
activity = new JG();
|
|
40765
40807
|
isPaused() {
|
|
40766
40808
|
return this.runtimeController.isPaused();
|
|
40767
40809
|
}
|
|
@@ -40920,7 +40962,7 @@ var qG = class {
|
|
|
40920
40962
|
causeMessage: e.message
|
|
40921
40963
|
} : typeof e == "string" && e.length > 0 ? { causeMessage: e } : {};
|
|
40922
40964
|
}
|
|
40923
|
-
},
|
|
40965
|
+
}, $N = class oP extends jc {
|
|
40924
40966
|
static CONFIG = I.object({ eventType: I.string({ nonEmpty: !0 }) });
|
|
40925
40967
|
configDecoder = oP.CONFIG;
|
|
40926
40968
|
globalOffs = [];
|
|
@@ -40947,7 +40989,7 @@ var qG = class {
|
|
|
40947
40989
|
for (const e of this.globalOffs) e();
|
|
40948
40990
|
this.globalOffs.length = 0;
|
|
40949
40991
|
}
|
|
40950
|
-
},
|
|
40992
|
+
}, qN = class {
|
|
40951
40993
|
runtime;
|
|
40952
40994
|
active;
|
|
40953
40995
|
setRuntime(t) {
|
|
@@ -40976,7 +41018,7 @@ var qG = class {
|
|
|
40976
41018
|
onSceneExit(t) {
|
|
40977
41019
|
this.active = void 0, this.runtime = void 0;
|
|
40978
41020
|
}
|
|
40979
|
-
},
|
|
41021
|
+
}, XN = class lP extends bc {
|
|
40980
41022
|
static POINTER_PAYLOAD = I.object({
|
|
40981
41023
|
pointerId: I.number({ integer: !0 }),
|
|
40982
41024
|
virtualX: I.number(),
|
|
@@ -41012,7 +41054,7 @@ var qG = class {
|
|
|
41012
41054
|
}
|
|
41013
41055
|
async afterSessionActivated(e) {
|
|
41014
41056
|
}
|
|
41015
|
-
},
|
|
41057
|
+
}, eN = class cP extends bc {
|
|
41016
41058
|
static POINTER_PAYLOAD = I.object({
|
|
41017
41059
|
pointerId: I.number({ integer: !0 }),
|
|
41018
41060
|
virtualX: I.number(),
|
|
@@ -41029,7 +41071,7 @@ var qG = class {
|
|
|
41029
41071
|
session: r
|
|
41030
41072
|
});
|
|
41031
41073
|
}
|
|
41032
|
-
},
|
|
41074
|
+
}, tN = class hP extends bc {
|
|
41033
41075
|
static POINTER_PAYLOAD = I.object({
|
|
41034
41076
|
pointerId: I.number({ integer: !0 }),
|
|
41035
41077
|
virtualX: I.number(),
|
|
@@ -41058,7 +41100,7 @@ var qG = class {
|
|
|
41058
41100
|
async handleMissingRuntime(e) {
|
|
41059
41101
|
e.sessionService.clearActive(e.session);
|
|
41060
41102
|
}
|
|
41061
|
-
},
|
|
41103
|
+
}, jN = class uP extends bc {
|
|
41062
41104
|
static PAYLOAD = I.object({
|
|
41063
41105
|
phase: I.enumOf([
|
|
41064
41106
|
"start",
|
|
@@ -41090,15 +41132,15 @@ var qG = class {
|
|
|
41090
41132
|
async onCancel(e) {
|
|
41091
41133
|
await this.onEnd(e);
|
|
41092
41134
|
}
|
|
41093
|
-
},
|
|
41135
|
+
}, YN = class extends eN {
|
|
41094
41136
|
isOwnedByPointer(t, e) {
|
|
41095
41137
|
return t.pointerId === e;
|
|
41096
41138
|
}
|
|
41097
|
-
},
|
|
41139
|
+
}, KN = class extends tN {
|
|
41098
41140
|
isOwnedByPointer(t, e) {
|
|
41099
41141
|
return t.pointerId === e;
|
|
41100
41142
|
}
|
|
41101
|
-
},
|
|
41143
|
+
}, ZN = class {
|
|
41102
41144
|
context;
|
|
41103
41145
|
onSceneEnter(t) {
|
|
41104
41146
|
return this.context = t, this.onEnter(t);
|
|
@@ -41128,7 +41170,7 @@ var qG = class {
|
|
|
41128
41170
|
}, y_ = class {
|
|
41129
41171
|
static SceneReady = "SCENE_READY";
|
|
41130
41172
|
static SceneTick = "SCENE_TICK";
|
|
41131
|
-
},
|
|
41173
|
+
}, QN = class extends DT {
|
|
41132
41174
|
constructor(t) {
|
|
41133
41175
|
super(t);
|
|
41134
41176
|
}
|
|
@@ -41153,60 +41195,60 @@ var qG = class {
|
|
|
41153
41195
|
export {
|
|
41154
41196
|
sh as ActionRegistry,
|
|
41155
41197
|
MP as AssetManager,
|
|
41156
|
-
|
|
41198
|
+
sN as AssetManifestBuilder,
|
|
41157
41199
|
BP as AudioLoader,
|
|
41158
41200
|
zP as AudioManager,
|
|
41159
41201
|
rA as BaseAction,
|
|
41160
41202
|
qP as BaseCommand,
|
|
41161
41203
|
J2 as BaseComponent,
|
|
41162
41204
|
DT as BaseScene,
|
|
41163
|
-
|
|
41205
|
+
ZN as BaseSceneService,
|
|
41164
41206
|
nA as BaseTypedAction,
|
|
41165
41207
|
bc as BaseTypedCommand,
|
|
41166
41208
|
jc as BaseTypedComponent,
|
|
41167
|
-
|
|
41209
|
+
XN as BeginDragCoreCommandBase,
|
|
41168
41210
|
xL as BrowserInputGuard,
|
|
41169
41211
|
XP as CommandBus,
|
|
41170
41212
|
WP as CommandEventPayloadReader,
|
|
41171
41213
|
cT as CommandsGroup,
|
|
41172
41214
|
ru as ComponentRegistry,
|
|
41173
41215
|
hT as ComponentsGroup,
|
|
41174
|
-
|
|
41216
|
+
nN as ConfigEntry,
|
|
41175
41217
|
KP as ConfigStore,
|
|
41176
41218
|
Z2 as Container,
|
|
41177
|
-
|
|
41219
|
+
rN as DecodedConfigStore,
|
|
41178
41220
|
IP as DefaultBundleBuildPolicy,
|
|
41179
41221
|
yD as DefaultEventNormalizer,
|
|
41180
41222
|
iA as DiBootstrapValidator,
|
|
41181
41223
|
tD as DiContainer,
|
|
41182
41224
|
Te as DiTokens,
|
|
41183
|
-
|
|
41184
|
-
|
|
41185
|
-
|
|
41225
|
+
gN as DisplacementFilterComponent,
|
|
41226
|
+
qN as DragCoreSessionService,
|
|
41227
|
+
$N as DragInputBridgeComponent,
|
|
41186
41228
|
dT as ElementFactoriesGroup,
|
|
41187
|
-
|
|
41188
|
-
|
|
41189
|
-
|
|
41229
|
+
_N as Empty,
|
|
41230
|
+
tN as EndDragCoreCommandBase,
|
|
41231
|
+
WN as Engine,
|
|
41190
41232
|
iD as EngineDi,
|
|
41191
41233
|
_c as EngineError,
|
|
41192
41234
|
R as EngineErrorCode,
|
|
41193
41235
|
D as EngineErrorFactory,
|
|
41194
41236
|
_P as EngineErrorFormatter,
|
|
41195
|
-
|
|
41237
|
+
iN as EngineErrorGuard,
|
|
41196
41238
|
k as EngineSubsystem,
|
|
41197
41239
|
_L as EventBus,
|
|
41198
41240
|
kP as FontLoader,
|
|
41199
|
-
|
|
41241
|
+
QN as FsmDrivenScene,
|
|
41200
41242
|
y_ as FsmDrivenSceneLifecycleEvents,
|
|
41201
41243
|
sD as GameDiConfig,
|
|
41202
|
-
|
|
41244
|
+
fN as GameDiDefinition,
|
|
41203
41245
|
Nv as GameDistributionBootstrapContract,
|
|
41204
|
-
|
|
41205
|
-
|
|
41246
|
+
pN as GlobalDiDefinition,
|
|
41247
|
+
xN as Graphics,
|
|
41206
41248
|
qG as GsapTimelineBuilder,
|
|
41207
41249
|
ci as GsapTweenHandle,
|
|
41208
41250
|
XG as GsapTweenManager,
|
|
41209
|
-
|
|
41251
|
+
jN as HandleDragInputCommandBase,
|
|
41210
41252
|
DP as ImageLoader,
|
|
41211
41253
|
ZP as IndexedDbStorageAdapter,
|
|
41212
41254
|
bL as InputChannel,
|
|
@@ -41219,32 +41261,33 @@ export {
|
|
|
41219
41261
|
QP as LocalesService,
|
|
41220
41262
|
gr as NodeBase,
|
|
41221
41263
|
mF as NullPlatformAdapter,
|
|
41222
|
-
|
|
41264
|
+
yN as ParticleEmitterComponent,
|
|
41223
41265
|
nF as ParticlePresetResolver,
|
|
41224
41266
|
oF as ParticlesFactory,
|
|
41225
41267
|
aF as ParticlesManager,
|
|
41226
41268
|
RP as PathRelativeAssetIdStrategy,
|
|
41227
|
-
|
|
41269
|
+
aN as PersistentStorageAdapter,
|
|
41228
41270
|
Cu as PersistentStorageCoordinator,
|
|
41229
41271
|
lF as PhysicsConfigDecoder,
|
|
41230
41272
|
Pe as PhysicsErrors,
|
|
41231
41273
|
pF as PhysicsManager,
|
|
41232
|
-
|
|
41274
|
+
wN as PhysicsSceneService,
|
|
41233
41275
|
fF as PhysicsWorld,
|
|
41234
41276
|
Qn as PlatformCatalog,
|
|
41235
|
-
|
|
41277
|
+
TN as PlatformIntegrationsConfigContract,
|
|
41236
41278
|
CF as PlatformManager,
|
|
41237
|
-
|
|
41238
|
-
|
|
41239
|
-
|
|
41279
|
+
dN as PlayParticlesAction,
|
|
41280
|
+
KN as PointerOwnedEndDragCoreCommandBase,
|
|
41281
|
+
YN as PointerOwnedUpdateDragCoreCommandBase,
|
|
41240
41282
|
AF as PrefabManager,
|
|
41241
41283
|
PF as PrefabRepository,
|
|
41242
41284
|
Yc as ProviderGroup,
|
|
41243
41285
|
zF as ResizeScheduler,
|
|
41244
|
-
|
|
41286
|
+
vN as ResponsiveLayoutComponent,
|
|
41245
41287
|
qa as RuleBasedValidator,
|
|
41288
|
+
JG as RuntimeActivity,
|
|
41246
41289
|
WF as Scaler,
|
|
41247
|
-
|
|
41290
|
+
mN as SceneDiDefinition,
|
|
41248
41291
|
vD as SceneFSM,
|
|
41249
41292
|
gD as SceneLayout,
|
|
41250
41293
|
HF as SceneManager,
|
|
@@ -41253,22 +41296,22 @@ export {
|
|
|
41253
41296
|
rD as SceneServiceTokenRegistry,
|
|
41254
41297
|
I as SchemaDecoder,
|
|
41255
41298
|
$F as ScreenManager,
|
|
41256
|
-
|
|
41257
|
-
|
|
41299
|
+
oN as SettingsEntry,
|
|
41300
|
+
lN as SettingsService,
|
|
41258
41301
|
Rv as Sprite,
|
|
41259
|
-
|
|
41302
|
+
cN as StorageNamespace,
|
|
41260
41303
|
Ce as SystemServices,
|
|
41261
|
-
|
|
41304
|
+
SN as Text,
|
|
41262
41305
|
YP as TextStylesConfigDecoder,
|
|
41263
41306
|
Q2 as TextureAssetResolver,
|
|
41264
|
-
|
|
41307
|
+
bN as TexturedRope,
|
|
41265
41308
|
Iv as TilingSprite,
|
|
41266
|
-
|
|
41267
|
-
|
|
41309
|
+
hN as TypedStateStore,
|
|
41310
|
+
eN as UpdateDragCoreCommandBase,
|
|
41268
41311
|
FP as ValidatorRegistry,
|
|
41269
41312
|
fT as ValuesGroup,
|
|
41270
41313
|
pT as ValuesGroupRegistrar,
|
|
41271
41314
|
SL as defaultInputConfig,
|
|
41272
|
-
|
|
41315
|
+
uN as registerElementFactory,
|
|
41273
41316
|
sA as registerSystemProviders
|
|
41274
41317
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamedevland/engine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "HTML5 game engine SDK for AI-assisted web game development.",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"author": "Gamedev Land",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"gamedev",
|
|
@@ -124,5 +124,14 @@
|
|
|
124
124
|
"howler": "^2.2.4",
|
|
125
125
|
"matter-js": "^0.20.0",
|
|
126
126
|
"pixi.js": "^8.16.0"
|
|
127
|
+
},
|
|
128
|
+
"repository": {
|
|
129
|
+
"type": "git",
|
|
130
|
+
"url": "git+https://github.com/gamedevland/sdk.git",
|
|
131
|
+
"directory": "packages/engine"
|
|
132
|
+
},
|
|
133
|
+
"homepage": "https://github.com/gamedevland/sdk/tree/main/packages/engine#readme",
|
|
134
|
+
"bugs": {
|
|
135
|
+
"url": "https://github.com/gamedevland/sdk/issues"
|
|
127
136
|
}
|
|
128
137
|
}
|