@zylem/game-lib 0.3.16 → 0.4.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 +39 -14
- package/dist/.vite/manifest.json +140 -64
- package/dist/api/actions.d.ts +5 -0
- package/dist/api/actions.d.ts.map +1 -0
- package/dist/api/behaviors.d.ts +4 -0
- package/dist/api/behaviors.d.ts.map +1 -0
- package/dist/api/camera.d.ts +4 -0
- package/dist/api/camera.d.ts.map +1 -0
- package/dist/api/core.d.ts +6 -0
- package/dist/api/core.d.ts.map +1 -0
- package/dist/api/entities.d.ts +9 -0
- package/dist/api/entities.d.ts.map +1 -0
- package/dist/api/main.d.ts +32 -0
- package/dist/api/main.d.ts.map +1 -0
- package/dist/api/stage.d.ts +7 -0
- package/dist/api/stage.d.ts.map +1 -0
- package/dist/core.js +4 -4
- package/dist/lib/actions/behaviors/actions.d.ts +1 -0
- package/dist/lib/actions/behaviors/actions.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/behavior.d.ts +1 -0
- package/dist/lib/actions/behaviors/behavior.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/boundaries/boundary.d.ts +1 -0
- package/dist/lib/actions/behaviors/boundaries/boundary.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/character-controller.d.ts +1 -0
- package/dist/lib/actions/behaviors/character-controller.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/debug/debug-collision.d.ts +1 -0
- package/dist/lib/actions/behaviors/debug/debug-collision.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/debug/debug-update.d.ts +1 -0
- package/dist/lib/actions/behaviors/debug/debug-update.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/debug/debug.d.ts +1 -0
- package/dist/lib/actions/behaviors/debug/debug.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +1 -0
- package/dist/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts +1 -0
- package/dist/lib/actions/behaviors/ricochet/ricochet.d.ts.map +1 -0
- package/dist/lib/actions/behaviors/zylem-behavior.d.ts +1 -0
- package/dist/lib/actions/behaviors/zylem-behavior.d.ts.map +1 -0
- package/dist/lib/actions/capabilities/moveable.d.ts +1 -0
- package/dist/lib/actions/capabilities/moveable.d.ts.map +1 -0
- package/dist/lib/actions/capabilities/rotatable.d.ts +1 -0
- package/dist/lib/actions/capabilities/rotatable.d.ts.map +1 -0
- package/dist/lib/actions/capabilities/transformable.d.ts +1 -0
- package/dist/lib/actions/capabilities/transformable.d.ts.map +1 -0
- package/dist/lib/actions/global-change.d.ts +1 -0
- package/dist/lib/actions/global-change.d.ts.map +1 -0
- package/dist/lib/camera/camera.d.ts +1 -0
- package/dist/lib/camera/camera.d.ts.map +1 -0
- package/dist/lib/camera/fixed-2d.d.ts +1 -0
- package/dist/lib/camera/fixed-2d.d.ts.map +1 -0
- package/dist/lib/camera/perspective.d.ts +1 -0
- package/dist/lib/camera/perspective.d.ts.map +1 -0
- package/dist/lib/camera/third-person.d.ts +1 -0
- package/dist/lib/camera/third-person.d.ts.map +1 -0
- package/dist/lib/camera/zylem-camera.d.ts +27 -0
- package/dist/lib/camera/zylem-camera.d.ts.map +1 -0
- package/dist/lib/camera/zylem-camera.js +100 -37
- package/dist/lib/collision/collision-builder.d.ts +1 -0
- package/dist/lib/collision/collision-builder.d.ts.map +1 -0
- package/dist/lib/collision/collision-delegate.d.ts +1 -0
- package/dist/lib/collision/collision-delegate.d.ts.map +1 -0
- package/dist/lib/collision/collision-group.d.ts +1 -0
- package/dist/lib/collision/collision-group.d.ts.map +1 -0
- package/dist/lib/collision/collision-mask.d.ts +1 -0
- package/dist/lib/collision/collision-mask.d.ts.map +1 -0
- package/dist/lib/collision/collision.d.ts +1 -0
- package/dist/lib/collision/collision.d.ts.map +1 -0
- package/dist/lib/collision/utils.d.ts +1 -0
- package/dist/lib/collision/utils.d.ts.map +1 -0
- package/dist/lib/collision/world.d.ts +1 -0
- package/dist/lib/collision/world.d.ts.map +1 -0
- package/dist/lib/core/asset-manager.d.ts +1 -0
- package/dist/lib/core/asset-manager.d.ts.map +1 -0
- package/dist/lib/core/base-node-life-cycle.d.ts +15 -0
- package/dist/lib/core/base-node-life-cycle.d.ts.map +1 -0
- package/dist/lib/core/base-node.d.ts +7 -2
- package/dist/lib/core/base-node.d.ts.map +1 -0
- package/dist/lib/core/base-node.js +7 -3
- package/dist/lib/core/entity-asset-loader.d.ts +1 -0
- package/dist/lib/core/entity-asset-loader.d.ts.map +1 -0
- package/dist/lib/core/errors.d.ts +1 -0
- package/dist/lib/core/errors.d.ts.map +1 -0
- package/dist/lib/core/flags.d.ts +1 -0
- package/dist/lib/core/flags.d.ts.map +1 -0
- package/dist/lib/core/index.d.ts +1 -0
- package/dist/lib/core/index.d.ts.map +1 -0
- package/dist/lib/core/lazy-loader.d.ts +3 -2
- package/dist/lib/core/lazy-loader.d.ts.map +1 -0
- package/dist/lib/core/lifecycle-base.d.ts +1 -0
- package/dist/lib/core/lifecycle-base.d.ts.map +1 -0
- package/dist/lib/core/preset-shader.d.ts +1 -0
- package/dist/lib/core/preset-shader.d.ts.map +1 -0
- package/dist/lib/core/three-addons/Timer.d.ts +1 -0
- package/dist/lib/core/three-addons/Timer.d.ts.map +1 -0
- package/dist/lib/core/utility/nodes.d.ts +13 -0
- package/dist/lib/core/utility/nodes.d.ts.map +1 -0
- package/dist/lib/core/utility/nodes.js +31 -0
- package/dist/lib/core/utility/strings.d.ts +3 -0
- package/dist/lib/core/utility/strings.d.ts.map +1 -0
- package/dist/lib/core/utility/strings.js +14 -0
- package/dist/lib/core/{utility.d.ts → utility/vector.d.ts} +1 -2
- package/dist/lib/core/utility/vector.d.ts.map +1 -0
- package/dist/lib/core/utility/vector.js +8 -0
- package/dist/lib/core/vector.d.ts +1 -0
- package/dist/lib/core/vector.d.ts.map +1 -0
- package/dist/lib/core/vessel.d.ts +4 -1
- package/dist/lib/core/vessel.d.ts.map +1 -0
- package/dist/lib/core/vessel.js +13 -9
- package/dist/lib/debug/console/console-state.d.ts +1 -0
- package/dist/lib/debug/console/console-state.d.ts.map +1 -0
- package/dist/lib/debug/console/console-store.d.ts +1 -0
- package/dist/lib/debug/console/console-store.d.ts.map +1 -0
- package/dist/lib/debug/debug-state.d.ts +1 -0
- package/dist/lib/debug/debug-state.d.ts.map +1 -0
- package/dist/lib/debug/debug-store.d.ts +1 -0
- package/dist/lib/debug/debug-store.d.ts.map +1 -0
- package/dist/lib/debug/state-based-debug-loader.d.ts +1 -0
- package/dist/lib/debug/state-based-debug-loader.d.ts.map +1 -0
- package/dist/lib/device/aspect-ratio.d.ts +38 -0
- package/dist/lib/device/aspect-ratio.d.ts.map +1 -0
- package/dist/lib/device/aspect-ratio.js +44 -0
- package/dist/lib/device/desktop.d.ts +1 -0
- package/dist/lib/device/desktop.d.ts.map +1 -0
- package/dist/lib/device/mobile.d.ts +1 -0
- package/dist/lib/device/mobile.d.ts.map +1 -0
- package/dist/lib/device/tablet.d.ts +1 -0
- package/dist/lib/device/tablet.d.ts.map +1 -0
- package/dist/lib/entities/actor.d.ts +1 -0
- package/dist/lib/entities/actor.d.ts.map +1 -0
- package/dist/lib/entities/box.d.ts +1 -0
- package/dist/lib/entities/box.d.ts.map +1 -0
- package/dist/lib/entities/builder.d.ts +1 -0
- package/dist/lib/entities/builder.d.ts.map +1 -0
- package/dist/lib/entities/create.d.ts +1 -0
- package/dist/lib/entities/create.d.ts.map +1 -0
- package/dist/lib/entities/delegates/animation.d.ts +1 -0
- package/dist/lib/entities/delegates/animation.d.ts.map +1 -0
- package/dist/lib/entities/delegates/debug.d.ts +1 -0
- package/dist/lib/entities/delegates/debug.d.ts.map +1 -0
- package/dist/lib/entities/delegates/loader.d.ts +1 -0
- package/dist/lib/entities/delegates/loader.d.ts.map +1 -0
- package/dist/lib/entities/destroy.d.ts +1 -0
- package/dist/lib/entities/destroy.d.ts.map +1 -0
- package/dist/lib/entities/entity.d.ts +4 -1
- package/dist/lib/entities/entity.d.ts.map +1 -0
- package/dist/lib/entities/entity.js +9 -5
- package/dist/lib/entities/index.d.ts +1 -0
- package/dist/lib/entities/index.d.ts.map +1 -0
- package/dist/lib/entities/plane.d.ts +1 -0
- package/dist/lib/entities/plane.d.ts.map +1 -0
- package/dist/lib/entities/rect.d.ts +1 -0
- package/dist/lib/entities/rect.d.ts.map +1 -0
- package/dist/lib/entities/sphere.d.ts +1 -0
- package/dist/lib/entities/sphere.d.ts.map +1 -0
- package/dist/lib/entities/sprite.d.ts +1 -0
- package/dist/lib/entities/sprite.d.ts.map +1 -0
- package/dist/lib/entities/text.d.ts +8 -0
- package/dist/lib/entities/text.d.ts.map +1 -0
- package/dist/lib/entities/text.js +77 -48
- package/dist/lib/entities/zone.d.ts +1 -0
- package/dist/lib/entities/zone.d.ts.map +1 -0
- package/dist/lib/game/game-blueprint.d.ts +38 -0
- package/dist/lib/game/game-blueprint.d.ts.map +1 -0
- package/dist/lib/game/game-canvas.d.ts +35 -0
- package/dist/lib/game/game-canvas.d.ts.map +1 -0
- package/dist/lib/game/game-canvas.js +57 -0
- package/dist/lib/game/game-config.d.ts +63 -0
- package/dist/lib/game/game-config.d.ts.map +1 -0
- package/dist/lib/game/game-config.js +79 -0
- package/dist/lib/game/game-default.d.ts +19 -0
- package/dist/lib/game/game-default.d.ts.map +1 -0
- package/dist/lib/game/game-default.js +24 -0
- package/dist/lib/game/game-interfaces.d.ts +3 -2
- package/dist/lib/game/game-interfaces.d.ts.map +1 -0
- package/dist/lib/game/game-retro-resolutions.d.ts +24 -0
- package/dist/lib/game/game-retro-resolutions.d.ts.map +1 -0
- package/dist/lib/game/game-retro-resolutions.js +81 -0
- package/dist/lib/game/game-state.d.ts +6 -5
- package/dist/lib/game/game-state.d.ts.map +1 -0
- package/dist/lib/game/game.d.ts +8 -12
- package/dist/lib/game/game.d.ts.map +1 -0
- package/dist/lib/game/game.js +44 -92
- package/dist/lib/game/zylem-game.d.ts +15 -3
- package/dist/lib/game/zylem-game.d.ts.map +1 -0
- package/dist/lib/game/zylem-game.js +67 -33
- package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts +1 -0
- package/dist/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +1 -0
- package/dist/lib/graphics/material.d.ts +2 -1
- package/dist/lib/graphics/material.d.ts.map +1 -0
- package/dist/lib/graphics/material.js +1 -1
- package/dist/lib/graphics/mesh.d.ts +1 -0
- package/dist/lib/graphics/mesh.d.ts.map +1 -0
- package/dist/lib/graphics/render-pass.d.ts +1 -0
- package/dist/lib/graphics/render-pass.d.ts.map +1 -0
- package/dist/lib/graphics/zylem-scene.d.ts +8 -7
- package/dist/lib/graphics/zylem-scene.d.ts.map +1 -0
- package/dist/lib/graphics/zylem-scene.js +26 -40
- package/dist/lib/input/gamepad-provider.d.ts +1 -0
- package/dist/lib/input/gamepad-provider.d.ts.map +1 -0
- package/dist/lib/input/input-manager.d.ts +1 -0
- package/dist/lib/input/input-manager.d.ts.map +1 -0
- package/dist/lib/input/input-provider.d.ts +1 -0
- package/dist/lib/input/input-provider.d.ts.map +1 -0
- package/dist/lib/input/input.d.ts +1 -0
- package/dist/lib/input/input.d.ts.map +1 -0
- package/dist/lib/input/keyboard-provider.d.ts +1 -0
- package/dist/lib/input/keyboard-provider.d.ts.map +1 -0
- package/dist/lib/interfaces/entity.d.ts +1 -0
- package/dist/lib/interfaces/entity.d.ts.map +1 -0
- package/dist/lib/sounds/index.d.ts +1 -0
- package/dist/lib/sounds/index.d.ts.map +1 -0
- package/dist/lib/sounds/ping-pong-sound.d.ts +1 -0
- package/dist/lib/sounds/ping-pong-sound.d.ts.map +1 -0
- package/dist/lib/sounds/ricochet-sound.d.ts +1 -0
- package/dist/lib/sounds/ricochet-sound.d.ts.map +1 -0
- package/dist/lib/stage/debug-entity-cursor.d.ts +1 -0
- package/dist/lib/stage/debug-entity-cursor.d.ts.map +1 -0
- package/dist/lib/stage/entity-spawner.d.ts +1 -0
- package/dist/lib/stage/entity-spawner.d.ts.map +1 -0
- package/dist/lib/stage/stage-blueprint.d.ts +45 -0
- package/dist/lib/stage/stage-blueprint.d.ts.map +1 -0
- package/dist/lib/stage/stage-blueprint.js +56 -0
- package/dist/lib/stage/stage-camera-debug-delegate.d.ts +14 -0
- package/dist/lib/stage/stage-camera-debug-delegate.d.ts.map +1 -0
- package/dist/lib/stage/stage-debug-delegate.d.ts +1 -0
- package/dist/lib/stage/stage-debug-delegate.d.ts.map +1 -0
- package/dist/lib/stage/stage-default.d.ts +10 -0
- package/dist/lib/stage/stage-default.d.ts.map +1 -0
- package/dist/lib/stage/stage-default.js +42 -0
- package/dist/lib/stage/stage-state.d.ts +1 -0
- package/dist/lib/stage/stage-state.d.ts.map +1 -0
- package/dist/lib/stage/stage.d.ts +4 -3
- package/dist/lib/stage/stage.d.ts.map +1 -0
- package/dist/lib/stage/stage.js +27 -25
- package/dist/lib/stage/zylem-stage.d.ts +8 -4
- package/dist/lib/stage/zylem-stage.d.ts.map +1 -0
- package/dist/lib/stage/zylem-stage.js +36 -46
- package/dist/lib/systems/test-system.d.ts +1 -0
- package/dist/lib/systems/test-system.d.ts.map +1 -0
- package/dist/lib/systems/transformable.system.d.ts +1 -0
- package/dist/lib/systems/transformable.system.d.ts.map +1 -0
- package/dist/lib/types/entity-types.d.ts +1 -0
- package/dist/lib/types/entity-types.d.ts.map +1 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/stage-types.d.ts +1 -0
- package/dist/lib/types/stage-types.d.ts.map +1 -0
- package/dist/lib/ui/Debug.d.ts +1 -0
- package/dist/lib/ui/Debug.d.ts.map +1 -0
- package/dist/lib/ui/console/Console.d.ts +1 -0
- package/dist/lib/ui/console/Console.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/AccordionMenu.d.ts +1 -0
- package/dist/lib/ui/debug-panel/AccordionMenu.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/Menu.d.ts +1 -0
- package/dist/lib/ui/debug-panel/Menu.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts +1 -0
- package/dist/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/sections/GameSection.d.ts +1 -0
- package/dist/lib/ui/debug-panel/sections/GameSection.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts +1 -0
- package/dist/lib/ui/debug-panel/sections/StagesSection.d.ts.map +1 -0
- package/dist/lib/ui/debug-panel/sections/all.d.ts +1 -0
- package/dist/lib/ui/debug-panel/sections/all.d.ts.map +1 -0
- package/dist/lib/ui/toolbar/Toolbar.d.ts +1 -0
- package/dist/lib/ui/toolbar/Toolbar.d.ts.map +1 -0
- package/dist/main.js +52 -50
- package/dist/stage.js +20 -4
- package/dist/tests/unit/collision/collision.spec.d.ts +2 -0
- package/dist/tests/unit/collision/collision.spec.d.ts.map +1 -0
- package/dist/tests/unit/core/game.spec.d.ts +2 -0
- package/dist/tests/unit/core/game.spec.d.ts.map +1 -0
- package/dist/tests/unit/core/stage.spec.d.ts +2 -0
- package/dist/tests/unit/core/stage.spec.d.ts.map +1 -0
- package/dist/tests/unit/core/vessel.spec.d.ts +2 -0
- package/dist/tests/unit/core/vessel.spec.d.ts.map +1 -0
- package/dist/tests/unit/stage/stage-blueprint.spec.d.ts +2 -0
- package/dist/tests/unit/stage/stage-blueprint.spec.d.ts.map +1 -0
- package/package.json +11 -9
- package/dist/actions.d.ts +0 -4
- package/dist/behaviors.d.ts +0 -3
- package/dist/camera.d.ts +0 -3
- package/dist/core.d.ts +0 -5
- package/dist/entities.d.ts +0 -8
- package/dist/lib/core/game-canvas.d.ts +0 -4
- package/dist/lib/core/utility.js +0 -20
- package/dist/main.d.ts +0 -30
- package/dist/stage.d.ts +0 -3
- package/dist/tests/collision/collision.spec.d.ts +0 -1
- package/dist/tests/core/game.spec.d.ts +0 -1
- package/dist/tests/core/stage.spec.d.ts +0 -1
- package/dist/tests/core/vessel.spec.d.ts +0 -1
|
@@ -6,13 +6,14 @@ import { SetupContext, UpdateContext, DestroyContext } from '../core/base-node-l
|
|
|
6
6
|
import { LifeCycleBase } from '../core/lifecycle-base';
|
|
7
7
|
import { BaseNode } from '../core/base-node';
|
|
8
8
|
import { Stage } from './stage';
|
|
9
|
-
import { ZylemCamera } from '../camera/zylem-camera';
|
|
10
9
|
import { CameraWrapper } from '../camera/camera';
|
|
11
10
|
import { StageDebugDelegate } from './stage-debug-delegate';
|
|
11
|
+
import { StageCameraDebugDelegate } from './stage-camera-debug-delegate';
|
|
12
12
|
import { BaseEntityInterface } from '../types/entity-types';
|
|
13
|
+
import { ZylemCamera } from '../camera/zylem-camera';
|
|
13
14
|
export interface ZylemStageConfig {
|
|
14
15
|
inputs: Record<string, string[]>;
|
|
15
|
-
backgroundColor: Color;
|
|
16
|
+
backgroundColor: Color | string;
|
|
16
17
|
backgroundImage: string | null;
|
|
17
18
|
gravity: Vector3;
|
|
18
19
|
variables: Record<string, any>;
|
|
@@ -21,8 +22,9 @@ export interface ZylemStageConfig {
|
|
|
21
22
|
type NodeLike = {
|
|
22
23
|
create: Function;
|
|
23
24
|
};
|
|
24
|
-
type StageEntityInput = NodeLike | Promise<any> | (() => NodeLike | Promise<any>);
|
|
25
|
-
export type
|
|
25
|
+
export type StageEntityInput = NodeLike | Promise<any> | (() => NodeLike | Promise<any>);
|
|
26
|
+
export type StageOptionItem = Partial<ZylemStageConfig> | CameraWrapper | StageEntityInput;
|
|
27
|
+
export type StageOptions = [] | [Partial<ZylemStageConfig>, ...StageOptionItem[]];
|
|
26
28
|
export type StageState = ZylemStageConfig & {
|
|
27
29
|
entities: GameEntityInterface[];
|
|
28
30
|
};
|
|
@@ -54,6 +56,7 @@ export declare class ZylemStage extends LifeCycleBase<ZylemStage> {
|
|
|
54
56
|
testSystem: any;
|
|
55
57
|
transformSystem: any;
|
|
56
58
|
debugDelegate: StageDebugDelegate | null;
|
|
59
|
+
cameraDebugDelegate: StageCameraDebugDelegate | null;
|
|
57
60
|
uuid: string;
|
|
58
61
|
wrapperRef: Stage | null;
|
|
59
62
|
camera?: CameraWrapper;
|
|
@@ -123,3 +126,4 @@ export declare class ZylemStage extends LifeCycleBase<ZylemStage> {
|
|
|
123
126
|
enqueue(...items: StageEntityInput[]): void;
|
|
124
127
|
}
|
|
125
128
|
export {};
|
|
129
|
+
//# sourceMappingURL=zylem-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zylem-stage.d.ts","sourceRoot":"","sources":["../../../src/lib/stage/zylem-stage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAK5D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM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Aa,CAAC,UAAU,CAAC,GAAG,IAAI;IAoBnD,SAAS;IAIhB,oDAAoD;IAC7C,WAAW;IAMlB,2DAA2D;IAC3D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI;IAsB5D;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,QAAQ;IA6BjC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAW/D,4DAA4D;IAC5D,gBAAgB,CAAC,MAAM,EAAE,QAAQ;IAcjC;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE;IAY1F;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IA+BzC,4DAA4D;IAC5D,eAAe,CAAC,IAAI,EAAE,MAAM;IAS5B,kBAAkB;IAIlB,gCAAgC;IAChC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpC;;;;;OAKG;IACH,OAAO,CAAC,GAAG,KAAK,EAAE,gBAAgB,EAAE;CAyBpC"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { createWorld as
|
|
2
|
-
import { Vector3 as o, Vector2 as
|
|
3
|
-
import { ZylemWorld as
|
|
4
|
-
import { ZylemScene as
|
|
5
|
-
import { setStageBackgroundColor as
|
|
6
|
-
import { ZylemBlueColor as
|
|
1
|
+
import { createWorld as c, addEntity as u, addComponent as f, removeEntity as p } from "bitecs";
|
|
2
|
+
import { Vector3 as o, Color as d, Vector2 as m } from "three";
|
|
3
|
+
import { ZylemWorld as l } from "../collision/world.js";
|
|
4
|
+
import { ZylemScene as y } from "../graphics/zylem-scene.js";
|
|
5
|
+
import { setStageBackgroundColor as g, setStageBackgroundImage as E, setStageVariables as b, resetStageVariables as w } from "./stage-state.js";
|
|
6
|
+
import { ZylemBlueColor as S } from "../core/utility/vector.js";
|
|
7
7
|
import { debugState as a } from "../debug/debug-state.js";
|
|
8
8
|
import { getGlobalState as h } from "../game/game-state.js";
|
|
9
9
|
import { LifeCycleBase as v } from "../core/lifecycle-base.js";
|
|
10
|
-
import
|
|
11
|
-
import { BaseNode as
|
|
10
|
+
import M from "../systems/transformable.system.js";
|
|
11
|
+
import { BaseNode as _ } from "../core/base-node.js";
|
|
12
12
|
import { nanoid as C } from "nanoid";
|
|
13
|
-
import {
|
|
14
|
-
import { Perspectives as k } from "../camera/perspective.js";
|
|
13
|
+
import { Perspectives as D } from "../camera/perspective.js";
|
|
15
14
|
import { CameraWrapper as B } from "../camera/camera.js";
|
|
16
|
-
import { StageDebugDelegate as
|
|
17
|
-
import { GameEntity as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
import { StageDebugDelegate as O } from "./stage-debug-delegate.js";
|
|
16
|
+
import { GameEntity as P } from "../entities/entity.js";
|
|
17
|
+
import { ZylemCamera as R } from "../camera/zylem-camera.js";
|
|
18
|
+
const W = "Stage";
|
|
19
|
+
class Y extends v {
|
|
20
|
+
type = W;
|
|
21
21
|
state = {
|
|
22
|
-
backgroundColor:
|
|
22
|
+
backgroundColor: S,
|
|
23
23
|
backgroundImage: null,
|
|
24
24
|
inputs: {
|
|
25
25
|
p1: ["gamepad-1", "keyboard"],
|
|
@@ -40,10 +40,11 @@ class K extends v {
|
|
|
40
40
|
isLoaded = !1;
|
|
41
41
|
_debugMap = /* @__PURE__ */ new Map();
|
|
42
42
|
entityAddedHandlers = [];
|
|
43
|
-
ecs =
|
|
43
|
+
ecs = c();
|
|
44
44
|
testSystem = null;
|
|
45
45
|
transformSystem = null;
|
|
46
46
|
debugDelegate = null;
|
|
47
|
+
cameraDebugDelegate = null;
|
|
47
48
|
uuid;
|
|
48
49
|
wrapperRef = null;
|
|
49
50
|
camera;
|
|
@@ -55,18 +56,7 @@ class K extends v {
|
|
|
55
56
|
constructor(e = []) {
|
|
56
57
|
super(), this.world = null, this.scene = null, this.uuid = C();
|
|
57
58
|
const { config: t, entities: i, asyncEntities: s, camera: r } = this.parseOptions(e);
|
|
58
|
-
this.camera = r, this.children = i, this.pendingEntities = s, this.saveState({
|
|
59
|
-
backgroundColor: t.backgroundColor ?? this.state.backgroundColor,
|
|
60
|
-
backgroundImage: t.backgroundImage ?? this.state.backgroundImage,
|
|
61
|
-
inputs: t.inputs ?? this.state.inputs,
|
|
62
|
-
gravity: t.gravity ?? this.state.gravity,
|
|
63
|
-
variables: t.variables ?? this.state.variables,
|
|
64
|
-
entities: []
|
|
65
|
-
}), this.gravity = t.gravity ?? new o(0, 0, 0);
|
|
66
|
-
const n = this;
|
|
67
|
-
window.onresize = function() {
|
|
68
|
-
n.resize(window.innerWidth, window.innerHeight);
|
|
69
|
-
};
|
|
59
|
+
this.camera = r, this.children = i, this.pendingEntities = s, this.saveState({ ...this.state, ...t, entities: [] }), this.gravity = t.gravity ?? new o(0, 0, 0);
|
|
70
60
|
}
|
|
71
61
|
parseOptions(e) {
|
|
72
62
|
let t = {};
|
|
@@ -77,7 +67,7 @@ class K extends v {
|
|
|
77
67
|
return { config: t, entities: i, asyncEntities: s, camera: r };
|
|
78
68
|
}
|
|
79
69
|
isZylemStageConfig(e) {
|
|
80
|
-
return e && typeof e == "object" && !(e instanceof
|
|
70
|
+
return e && typeof e == "object" && !(e instanceof _) && !(e instanceof B);
|
|
81
71
|
}
|
|
82
72
|
isBaseNode(e) {
|
|
83
73
|
return e && typeof e == "object" && typeof e.create == "function";
|
|
@@ -101,8 +91,8 @@ class K extends v {
|
|
|
101
91
|
this.state = e;
|
|
102
92
|
}
|
|
103
93
|
setState() {
|
|
104
|
-
const { backgroundColor: e, backgroundImage: t } = this.state;
|
|
105
|
-
|
|
94
|
+
const { backgroundColor: e, backgroundImage: t } = this.state, i = e instanceof d ? e : new d(e);
|
|
95
|
+
g(i), E(t), b(this.state.variables ?? {});
|
|
106
96
|
}
|
|
107
97
|
/**
|
|
108
98
|
* Load and initialize the stage's scene and world.
|
|
@@ -112,9 +102,9 @@ class K extends v {
|
|
|
112
102
|
async load(e, t) {
|
|
113
103
|
this.setState();
|
|
114
104
|
const i = t || (this.camera ? this.camera.cameraRef : this.createDefaultCamera());
|
|
115
|
-
this.cameraRef = i, this.scene = new
|
|
116
|
-
const s = await
|
|
117
|
-
this.world = new
|
|
105
|
+
this.cameraRef = i, this.scene = new y(e, i, this.state);
|
|
106
|
+
const s = await l.loadPhysics(this.gravity ?? new o(0, 0, 0));
|
|
107
|
+
this.world = new l(s), this.scene.setup();
|
|
118
108
|
for (let r of this.children)
|
|
119
109
|
this.spawnEntity(r);
|
|
120
110
|
if (this.pendingEntities.length && (this.enqueue(...this.pendingEntities), this.pendingEntities = []), this.pendingPromises.length) {
|
|
@@ -122,18 +112,18 @@ class K extends v {
|
|
|
122
112
|
r.then((n) => this.spawnEntity(n)).catch((n) => console.error("Failed to resolve pending stage entity", n));
|
|
123
113
|
this.pendingPromises = [];
|
|
124
114
|
}
|
|
125
|
-
this.transformSystem =
|
|
115
|
+
this.transformSystem = M(this), this.isLoaded = !0;
|
|
126
116
|
}
|
|
127
117
|
createDefaultCamera() {
|
|
128
|
-
const e = window.innerWidth, t = window.innerHeight, i = new
|
|
129
|
-
return new
|
|
118
|
+
const e = window.innerWidth, t = window.innerHeight, i = new m(e, t);
|
|
119
|
+
return new R(D.ThirdPerson, i);
|
|
130
120
|
}
|
|
131
121
|
_setup(e) {
|
|
132
122
|
if (!this.scene || !this.world) {
|
|
133
123
|
this.logMissingEntities();
|
|
134
124
|
return;
|
|
135
125
|
}
|
|
136
|
-
a.on && (this.debugDelegate = new
|
|
126
|
+
a.on && (this.debugDelegate = new O(this));
|
|
137
127
|
}
|
|
138
128
|
_update(e) {
|
|
139
129
|
const { delta: t } = e;
|
|
@@ -162,7 +152,7 @@ class K extends v {
|
|
|
162
152
|
t.nodeDestroy({ me: t, globals: h() });
|
|
163
153
|
} catch {
|
|
164
154
|
}
|
|
165
|
-
}), this._childrenMap.clear(), this._removalMap.clear(), this._debugMap.clear(), this.world?.destroy(), this.scene?.destroy(), this.debugDelegate?.dispose(), this.isLoaded = !1, this.world = null, this.scene = null, this.cameraRef = null, w();
|
|
155
|
+
}), this._childrenMap.clear(), this._removalMap.clear(), this._debugMap.clear(), this.world?.destroy(), this.scene?.destroy(), this.debugDelegate?.dispose(), this.cameraRef?.setDebugDelegate(null), this.cameraDebugDelegate = null, this.isLoaded = !1, this.world = null, this.scene = null, this.cameraRef = null, w();
|
|
166
156
|
}
|
|
167
157
|
/**
|
|
168
158
|
* Create, register, and add an entity to the scene/world.
|
|
@@ -171,10 +161,10 @@ class K extends v {
|
|
|
171
161
|
async spawnEntity(e) {
|
|
172
162
|
if (!this.scene || !this.world)
|
|
173
163
|
return;
|
|
174
|
-
const t = e.create(), i =
|
|
164
|
+
const t = e.create(), i = u(this.ecs);
|
|
175
165
|
if (t.eid = i, this.scene.addEntity(t), e.behaviors)
|
|
176
166
|
for (let s of e.behaviors) {
|
|
177
|
-
|
|
167
|
+
f(this.ecs, s.component, t.eid);
|
|
178
168
|
const r = Object.keys(s.values);
|
|
179
169
|
for (const n of r)
|
|
180
170
|
s.component[n][t.eid] = s.values[n];
|
|
@@ -186,7 +176,7 @@ class K extends v {
|
|
|
186
176
|
}), this.addEntityToStage(t);
|
|
187
177
|
}
|
|
188
178
|
buildEntityState(e) {
|
|
189
|
-
return e instanceof
|
|
179
|
+
return e instanceof P ? { ...e.buildInfo() } : {
|
|
190
180
|
uuid: e.uuid,
|
|
191
181
|
name: e.name,
|
|
192
182
|
eid: e.eid
|
|
@@ -229,7 +219,7 @@ class K extends v {
|
|
|
229
219
|
const i = this.world.collisionMap.get(e) ?? this._debugMap.get(e);
|
|
230
220
|
if (!i)
|
|
231
221
|
return !1;
|
|
232
|
-
this.world.destroyEntity(i), i.group ? this.scene.scene.remove(i.group) : i.mesh && this.scene.scene.remove(i.mesh),
|
|
222
|
+
this.world.destroyEntity(i), i.group ? this.scene.scene.remove(i.group) : i.mesh && this.scene.scene.remove(i.mesh), p(this.ecs, i.eid);
|
|
233
223
|
let s = null;
|
|
234
224
|
return this._childrenMap.forEach((r, n) => {
|
|
235
225
|
r.uuid === e && (s = n);
|
|
@@ -274,6 +264,6 @@ class K extends v {
|
|
|
274
264
|
}
|
|
275
265
|
}
|
|
276
266
|
export {
|
|
277
|
-
|
|
278
|
-
|
|
267
|
+
W as STAGE_TYPE,
|
|
268
|
+
Y as ZylemStage
|
|
279
269
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-system.d.ts","sourceRoot":"","sources":["../../../src/lib/systems/test-system.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformable.system.d.ts","sourceRoot":"","sources":["../../../src/lib/systems/transformable.system.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACzB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC,SAAS,CAAA;KAAE,CAAC,CAAC;CACpE,CAAA;AAED,eAAO,MAAM,QAAQ;;;;EAInB,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;EAKnB,CAAC;AAEH,eAAO,MAAM,KAAK;;;;EAIhB,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,WAAW,wDA8C/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/entity-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,SAAS,EA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A,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/stage-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,eAAe,EAAE,KAAK,CAAC;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE;QACP,EAAE,EAAE,MAAM,EAAE,CAAC;QACb,EAAE,EAAE,MAAM,EAAE,CAAC;KACb,CAAC;IACF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,KAAK,EAAE,mBAAmB,CAAC;CAC3B"}
|
package/dist/lib/ui/Debug.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Debug.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/Debug.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Console.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/console/Console.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAGtE,OAAO,eAAe,CAAC;AAEvB;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,SA6BrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionMenu.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/debug-panel/AccordionMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,qBAAqB,CAAC;AAE7B;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAmC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/debug-panel/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C,OAAO,YAAY,CAAC;AAEpB,eAAO,MAAM,IAAI,EAAE,SAAS,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAYpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntitiesSection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/ui/debug-panel/sections/EntitiesSection.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAyC,MAAM,UAAU,CAAC;AAQ5E,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGlD,UAAU,cAAc;IACtB,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,cAAc,CAyB/C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SA2B7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GameSection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/ui/debug-panel/sections/GameSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAI1C,eAAO,MAAM,WAAW,EAAE,SAyBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StagesSection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/ui/debug-panel/sections/StagesSection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrC,eAAO,MAAM,aAAa,EAAE,SA2B3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../../../src/lib/ui/debug-panel/sections/all.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../src/lib/ui/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,eAAe,CAAC;AAIvB,eAAO,MAAM,OAAO,EAAE,SAAS,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CA0HvD,CAAC"}
|
package/dist/main.js
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
1
|
+
import { createGame as m } from "./lib/game/game.js";
|
|
2
|
+
import { gameConfig as a } from "./lib/game/game-config.js";
|
|
3
|
+
import { stage as f } from "./lib/stage/stage.js";
|
|
4
|
+
import { entitySpawner as s } from "./lib/stage/entity-spawner.js";
|
|
5
|
+
import { vessel as i } from "./lib/core/vessel.js";
|
|
6
|
+
import { camera as c } from "./lib/camera/camera.js";
|
|
7
|
+
import { Perspectives as h } from "./lib/camera/perspective.js";
|
|
8
|
+
import { ZylemBox as v, box as d } from "./lib/entities/box.js";
|
|
9
|
+
import { sphere as R } from "./lib/entities/sphere.js";
|
|
10
|
+
import { sprite as E } from "./lib/entities/sprite.js";
|
|
11
|
+
import { plane as w } from "./lib/entities/plane.js";
|
|
12
|
+
import { zone as D } from "./lib/entities/zone.js";
|
|
13
|
+
import { actor as I } from "./lib/entities/actor.js";
|
|
14
|
+
import { text as T } from "./lib/entities/text.js";
|
|
15
|
+
import { rect as A } from "./lib/entities/rect.js";
|
|
16
|
+
import { makeMoveable as M } from "./lib/actions/capabilities/moveable.js";
|
|
17
|
+
import { makeRotatable as Z } from "./lib/actions/capabilities/rotatable.js";
|
|
18
|
+
import { makeTransformable as q } from "./lib/actions/capabilities/transformable.js";
|
|
19
|
+
import { ricochet2DInBounds as J } from "./lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js";
|
|
20
|
+
import { ricochet2DCollision as L } from "./lib/actions/behaviors/ricochet/ricochet-2d-collision.js";
|
|
21
|
+
import { boundary2d as O } from "./lib/actions/behaviors/boundaries/boundary.js";
|
|
22
|
+
import { destroy as U } from "./lib/entities/destroy.js";
|
|
23
|
+
import { Howl as W } from "howler";
|
|
23
24
|
import * as o from "three";
|
|
24
25
|
import * as r from "@dimforge/rapier3d-compat";
|
|
25
|
-
import { globalChange as
|
|
26
|
+
import { globalChange as Y, globalChanges as _, variableChange as $, variableChanges as oo } from "./lib/actions/global-change.js";
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
W as Howl,
|
|
29
|
+
h as Perspectives,
|
|
29
30
|
r as RAPIER,
|
|
30
31
|
o as THREE,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
R as
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
32
|
+
v as ZylemBox,
|
|
33
|
+
I as actor,
|
|
34
|
+
O as boundary2d,
|
|
35
|
+
d as box,
|
|
36
|
+
c as camera,
|
|
37
|
+
m as createGame,
|
|
38
|
+
U as destroy,
|
|
39
|
+
s as entitySpawner,
|
|
40
|
+
a as gameConfig,
|
|
41
|
+
Y as globalChange,
|
|
42
|
+
_ as globalChanges,
|
|
43
|
+
M as makeMoveable,
|
|
44
|
+
Z as makeRotatable,
|
|
45
|
+
q as makeTransformable,
|
|
46
|
+
w as plane,
|
|
47
|
+
A as rect,
|
|
48
|
+
L as ricochet2DCollision,
|
|
49
|
+
J as ricochet2DInBounds,
|
|
50
|
+
R as sphere,
|
|
51
|
+
E as sprite,
|
|
52
|
+
f as stage,
|
|
53
|
+
T as text,
|
|
54
|
+
$ as variableChange,
|
|
55
|
+
oo as variableChanges,
|
|
56
|
+
i as vessel,
|
|
57
|
+
D as zone
|
|
56
58
|
};
|
package/dist/stage.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import { stage as
|
|
2
|
-
import { entitySpawner as
|
|
1
|
+
import { stage as r } from "./lib/stage/stage.js";
|
|
2
|
+
import { entitySpawner as g } from "./lib/stage/entity-spawner.js";
|
|
3
|
+
import { buildStageFromBlueprint as l, createStageBlueprint as p, getCurrentStageBlueprint as n, getStageBlueprint as s, listStageBlueprints as S, removeStageBlueprint as i, resetStageBlueprints as o, setCurrentStageBlueprint as B, stageBlueprintsState as f, upsertStageBlueprint as m } from "./lib/stage/stage-blueprint.js";
|
|
4
|
+
import { getStageDefaultConfig as D, resetStageDefaults as C, setStageDefaults as b, stageDefaultsState as c } from "./lib/stage/stage-default.js";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
l as buildStageFromBlueprint,
|
|
7
|
+
p as createStageBlueprint,
|
|
8
|
+
g as entitySpawner,
|
|
9
|
+
n as getCurrentStageBlueprint,
|
|
10
|
+
s as getStageBlueprint,
|
|
11
|
+
D as getStageDefaultConfig,
|
|
12
|
+
S as listStageBlueprints,
|
|
13
|
+
i as removeStageBlueprint,
|
|
14
|
+
o as resetStageBlueprints,
|
|
15
|
+
C as resetStageDefaults,
|
|
16
|
+
B as setCurrentStageBlueprint,
|
|
17
|
+
b as setStageDefaults,
|
|
18
|
+
r as stage,
|
|
19
|
+
f as stageBlueprintsState,
|
|
20
|
+
c as stageDefaultsState,
|
|
21
|
+
m as upsertStageBlueprint
|
|
6
22
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collision.spec.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit/collision/collision.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.spec.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit/core/game.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage.spec.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit/core/stage.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vessel.spec.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit/core/vessel.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage-blueprint.spec.d.ts","sourceRoot":"","sources":["../../../../src/tests/unit/stage/stage-blueprint.spec.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zylem/game-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A powerful and easy-to-use framework for creating simple 3D digital interactive applications using TypeScript.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"pnpm": ">=10.14.0"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
|
-
"build": "tsc && vite build
|
|
75
|
-
"build:watch": "tsc && vite build --watch
|
|
74
|
+
"build": "tsc && vite build",
|
|
75
|
+
"build:watch": "tsc && vite build --watch",
|
|
76
76
|
"build:preview": "vite build --mode development",
|
|
77
77
|
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
78
78
|
"lint:fix": "eslint \"**/*.{ts,tsx}\" --fix",
|
|
79
79
|
"test": "npx vitest --reporter=verbose",
|
|
80
80
|
"coverage": "vitest run --coverage",
|
|
81
81
|
"start": "vite",
|
|
82
|
-
"dev": "vite --host
|
|
82
|
+
"dev": "vite --host",
|
|
83
83
|
"serve": "npm run build:preview && vite preview --outDir dist-preview",
|
|
84
84
|
"docs": "yarn typedoc"
|
|
85
85
|
},
|
|
@@ -113,15 +113,16 @@
|
|
|
113
113
|
"three-instanced-uniforms-mesh": "^0.52.4",
|
|
114
114
|
"three-spritetext": "^1.10.0",
|
|
115
115
|
"tsimp": "^2.0.12",
|
|
116
|
+
"typescript-fsm": "^1.6.0",
|
|
116
117
|
"valtio": "^2.1.7"
|
|
117
118
|
},
|
|
118
119
|
"peerDependencies": {
|
|
119
|
-
"three": "^0.180.0",
|
|
120
120
|
"@dimforge/rapier3d-compat": "^0.11.2",
|
|
121
|
+
"bitecs": "^0.3.40",
|
|
121
122
|
"howler": "^2.2.4",
|
|
122
|
-
"valtio": "^2.1.7",
|
|
123
123
|
"nanoid": "^5.1.5",
|
|
124
|
-
"
|
|
124
|
+
"three": "^0.180.0",
|
|
125
|
+
"valtio": "^2.1.7"
|
|
125
126
|
},
|
|
126
127
|
"devDependencies": {
|
|
127
128
|
"@ava/typescript": "^5.0.0",
|
|
@@ -155,7 +156,8 @@
|
|
|
155
156
|
"vite-plugin-checker": "^0.5.6",
|
|
156
157
|
"vite-plugin-glsl": "^1.5.1",
|
|
157
158
|
"vite-plugin-solid": "^2.11.8",
|
|
158
|
-
"vitest": "^3.2.4"
|
|
159
|
+
"vitest": "^3.2.4",
|
|
160
|
+
"@microsoft/api-extractor": "^7.47.11"
|
|
159
161
|
},
|
|
160
|
-
"packageManager": "pnpm@10.
|
|
162
|
+
"packageManager": "pnpm@10.18.3"
|
|
161
163
|
}
|
package/dist/actions.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * as actions from './lib/actions/behaviors/actions';
|
|
2
|
-
export { makeMoveable } from './lib/actions/capabilities/moveable';
|
|
3
|
-
export { makeRotatable } from './lib/actions/capabilities/rotatable';
|
|
4
|
-
export { makeTransformable } from './lib/actions/capabilities/transformable';
|
package/dist/behaviors.d.ts
DELETED
package/dist/camera.d.ts
DELETED