@zylem/game-lib 0.5.0 → 0.5.1
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 +23 -41
- package/dist/actions.d.ts +25 -0
- package/dist/actions.js +287 -8
- package/dist/actions.js.map +1 -0
- package/dist/behaviors.d.ts +108 -0
- package/dist/behaviors.js +396 -6
- package/dist/behaviors.js.map +1 -0
- package/dist/{src/lib/camera/zylem-camera.d.ts → camera-Dk-fOVZE.d.ts} +55 -8
- package/dist/camera.d.ts +5 -0
- package/dist/camera.js +504 -4
- package/dist/camera.js.map +1 -0
- package/dist/core-C2mjetAd.d.ts +431 -0
- package/dist/core.d.ts +9 -0
- package/dist/core.js +4780 -9
- package/dist/core.js.map +1 -0
- package/dist/entities.d.ts +269 -0
- package/dist/entities.js +2161 -17
- package/dist/entities.js.map +1 -0
- package/dist/entity-bQElAdpo.d.ts +347 -0
- package/dist/entity-spawner-DNnLYnZq.d.ts +11 -0
- package/dist/main.d.ts +135 -0
- package/dist/main.js +6599 -56
- package/dist/main.js.map +1 -0
- package/dist/moveable-B_vyA6cw.d.ts +67 -0
- package/dist/stage-CrmY7V0i.d.ts +287 -0
- package/dist/stage.d.ts +26 -0
- package/dist/stage.js +2229 -4
- package/dist/stage.js.map +1 -0
- package/dist/transformable-CUhvyuYO.d.ts +67 -0
- package/package.json +9 -45
- package/LICENSE +0 -21
- package/dist/.vite/manifest.json +0 -716
- package/dist/assets/zylem-logo.png +0 -0
- package/dist/examples/00-readme-example.d.ts +0 -2
- package/dist/examples/00-readme-example.d.ts.map +0 -1
- package/dist/examples/01-basic.d.ts +0 -2
- package/dist/examples/01-basic.d.ts.map +0 -1
- package/dist/examples/01.1-basic-ball.d.ts +0 -9
- package/dist/examples/01.1-basic-ball.d.ts.map +0 -1
- package/dist/examples/01.2-ricochet-test.d.ts +0 -2
- package/dist/examples/01.2-ricochet-test.d.ts.map +0 -1
- package/dist/examples/01.3-rect.d.ts +0 -2
- package/dist/examples/01.3-rect.d.ts.map +0 -1
- package/dist/examples/02-input.d.ts +0 -2
- package/dist/examples/02-input.d.ts.map +0 -1
- package/dist/examples/03-stage-test/03-stage-test.d.ts +0 -2
- package/dist/examples/03-stage-test/03-stage-test.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage0.d.ts +0 -2
- package/dist/examples/03-stage-test/stage0.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage1.d.ts +0 -2
- package/dist/examples/03-stage-test/stage1.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage2.d.ts +0 -2
- package/dist/examples/03-stage-test/stage2.d.ts.map +0 -1
- package/dist/examples/03-stage-test/stage3.d.ts +0 -2
- package/dist/examples/03-stage-test/stage3.d.ts.map +0 -1
- package/dist/examples/03.1-stage-variable.d.ts +0 -2
- package/dist/examples/03.1-stage-variable.d.ts.map +0 -1
- package/dist/examples/04-vessel-test.d.ts +0 -18
- package/dist/examples/04-vessel-test.d.ts.map +0 -1
- package/dist/examples/05-camera-test.d.ts +0 -2
- package/dist/examples/05-camera-test.d.ts.map +0 -1
- package/dist/examples/06-entity-test.d.ts +0 -2
- package/dist/examples/06-entity-test.d.ts.map +0 -1
- package/dist/examples/07-behaviors.d.ts +0 -2
- package/dist/examples/07-behaviors.d.ts.map +0 -1
- package/dist/examples/07.01-behavior-context.d.ts +0 -2
- package/dist/examples/07.01-behavior-context.d.ts.map +0 -1
- package/dist/examples/08-pong.d.ts +0 -2
- package/dist/examples/08-pong.d.ts.map +0 -1
- package/dist/examples/08.01-breakout.d.ts +0 -2
- package/dist/examples/08.01-breakout.d.ts.map +0 -1
- package/dist/examples/09-space-invaders.d.ts +0 -2
- package/dist/examples/09-space-invaders.d.ts.map +0 -1
- package/dist/examples/10-asteroids.d.ts +0 -2
- package/dist/examples/10-asteroids.d.ts.map +0 -1
- package/dist/examples/11-2d-platformer.d.ts +0 -2
- package/dist/examples/11-2d-platformer.d.ts.map +0 -1
- package/dist/examples/12-3d-platformer.d.ts +0 -2
- package/dist/examples/12-3d-platformer.d.ts.map +0 -1
- package/dist/examples/13-fps.d.ts +0 -2
- package/dist/examples/13-fps.d.ts.map +0 -1
- package/dist/examples/14-strategy.d.ts +0 -2
- package/dist/examples/14-strategy.d.ts.map +0 -1
- package/dist/examples/15-zylem-planet-demo.d.ts +0 -2
- package/dist/examples/15-zylem-planet-demo.d.ts.map +0 -1
- package/dist/examples/16-timbotron.d.ts +0 -2
- package/dist/examples/16-timbotron.d.ts.map +0 -1
- package/dist/examples/17-stress-test.d.ts +0 -2
- package/dist/examples/17-stress-test.d.ts.map +0 -1
- package/dist/examples/architecture-test.d.ts +0 -2
- package/dist/examples/architecture-test.d.ts.map +0 -1
- package/dist/examples/utils.d.ts +0 -10
- package/dist/examples/utils.d.ts.map +0 -1
- package/dist/lib/actions/behaviors/actions.js +0 -35
- package/dist/lib/actions/behaviors/boundaries/boundary.js +0 -40
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-collision.js +0 -100
- package/dist/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.js +0 -37
- package/dist/lib/actions/behaviors/ricochet/ricochet.js +0 -6
- package/dist/lib/actions/capabilities/moveable.js +0 -108
- package/dist/lib/actions/capabilities/rotatable.js +0 -82
- package/dist/lib/actions/capabilities/transformable.js +0 -9
- package/dist/lib/actions/global-change.js +0 -40
- package/dist/lib/camera/camera.js +0 -19
- package/dist/lib/camera/fixed-2d.js +0 -30
- package/dist/lib/camera/perspective.js +0 -10
- package/dist/lib/camera/third-person.js +0 -42
- package/dist/lib/camera/zylem-camera.js +0 -208
- package/dist/lib/collision/collision-builder.js +0 -46
- package/dist/lib/collision/collision-delegate.js +0 -6
- package/dist/lib/collision/utils.js +0 -24
- package/dist/lib/collision/world.js +0 -77
- package/dist/lib/core/base-node.js +0 -61
- package/dist/lib/core/entity-asset-loader.js +0 -54
- package/dist/lib/core/lifecycle-base.js +0 -20
- package/dist/lib/core/preset-shader.js +0 -26
- package/dist/lib/core/three-addons/Timer.js +0 -103
- package/dist/lib/core/utility/nodes.js +0 -31
- package/dist/lib/core/utility/strings.js +0 -14
- package/dist/lib/core/utility/vector.js +0 -8
- package/dist/lib/core/vessel.js +0 -26
- package/dist/lib/debug/console/console-state.js +0 -11
- package/dist/lib/debug/debug-state.js +0 -40
- package/dist/lib/device/aspect-ratio.js +0 -44
- package/dist/lib/entities/actor.js +0 -122
- package/dist/lib/entities/box.js +0 -68
- package/dist/lib/entities/builder.js +0 -79
- package/dist/lib/entities/create.js +0 -31
- package/dist/lib/entities/delegates/animation.js +0 -58
- package/dist/lib/entities/delegates/debug.js +0 -71
- package/dist/lib/entities/delegates/loader.js +0 -19
- package/dist/lib/entities/destroy.js +0 -15
- package/dist/lib/entities/entity-factory.js +0 -24
- package/dist/lib/entities/entity.js +0 -121
- package/dist/lib/entities/plane.js +0 -81
- package/dist/lib/entities/rect.js +0 -160
- package/dist/lib/entities/sphere.js +0 -68
- package/dist/lib/entities/sprite.js +0 -125
- package/dist/lib/entities/text.js +0 -140
- package/dist/lib/entities/zone.js +0 -103
- package/dist/lib/game/game-canvas.js +0 -57
- package/dist/lib/game/game-config.js +0 -78
- package/dist/lib/game/game-default.js +0 -23
- package/dist/lib/game/game-retro-resolutions.js +0 -80
- package/dist/lib/game/game-state.js +0 -17
- package/dist/lib/game/game.js +0 -131
- package/dist/lib/game/zylem-game.js +0 -140
- package/dist/lib/graphics/geometries/XZPlaneGeometry.js +0 -34
- package/dist/lib/graphics/material.js +0 -64
- package/dist/lib/graphics/mesh.js +0 -14
- package/dist/lib/graphics/render-pass.js +0 -56
- package/dist/lib/graphics/shaders/fragment/debug.glsl.js +0 -23
- package/dist/lib/graphics/shaders/fragment/fire.glsl.js +0 -52
- package/dist/lib/graphics/shaders/fragment/standard.glsl.js +0 -11
- package/dist/lib/graphics/shaders/fragment/stars.glsl.js +0 -44
- package/dist/lib/graphics/shaders/vertex/debug.glsl.js +0 -15
- package/dist/lib/graphics/shaders/vertex/object-shader.glsl.js +0 -11
- package/dist/lib/graphics/shaders/vertex/standard.glsl.js +0 -9
- package/dist/lib/graphics/zylem-scene.js +0 -75
- package/dist/lib/input/gamepad-provider.js +0 -58
- package/dist/lib/input/input-manager.js +0 -70
- package/dist/lib/input/keyboard-provider.js +0 -120
- package/dist/lib/stage/debug-entity-cursor.js +0 -53
- package/dist/lib/stage/entity-spawner.js +0 -27
- package/dist/lib/stage/stage-debug-delegate.js +0 -100
- package/dist/lib/stage/stage-default.js +0 -32
- package/dist/lib/stage/stage-factory.js +0 -22
- package/dist/lib/stage/stage-manager.js +0 -49
- package/dist/lib/stage/stage-state.js +0 -36
- package/dist/lib/stage/stage.js +0 -67
- package/dist/lib/stage/zylem-stage.js +0 -268
- package/dist/lib/systems/transformable.system.js +0 -43
- package/dist/node_modules/.pnpm/idb-keyval@6.2.2/node_modules/idb-keyval/dist/index.js +0 -34
- package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/pack.js +0 -520
- package/dist/node_modules/.pnpm/msgpackr@1.11.5/node_modules/msgpackr/unpack.js +0 -672
- package/dist/src/api/actions.d.ts +0 -5
- package/dist/src/api/actions.d.ts.map +0 -1
- package/dist/src/api/behaviors.d.ts +0 -4
- package/dist/src/api/behaviors.d.ts.map +0 -1
- package/dist/src/api/camera.d.ts +0 -4
- package/dist/src/api/camera.d.ts.map +0 -1
- package/dist/src/api/core.d.ts +0 -6
- package/dist/src/api/core.d.ts.map +0 -1
- package/dist/src/api/entities.d.ts +0 -9
- package/dist/src/api/entities.d.ts.map +0 -1
- package/dist/src/api/main.d.ts +0 -32
- package/dist/src/api/main.d.ts.map +0 -1
- package/dist/src/api/stage.d.ts +0 -5
- package/dist/src/api/stage.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/actions.d.ts +0 -11
- package/dist/src/lib/actions/behaviors/actions.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/behavior.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/behavior.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts +0 -37
- package/dist/src/lib/actions/behaviors/boundaries/boundary.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/character-controller.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/character-controller.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts +0 -6
- package/dist/src/lib/actions/behaviors/debug/debug-collision.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts +0 -5
- package/dist/src/lib/actions/behaviors/debug/debug-update.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/debug/debug.d.ts +0 -10
- package/dist/src/lib/actions/behaviors/debug/debug.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts +0 -24
- package/dist/src/lib/actions/behaviors/movement/movement-sequence-2d.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts +0 -11
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-collision.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts +0 -12
- package/dist/src/lib/actions/behaviors/ricochet/ricochet-2d-in-bounds.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts +0 -44
- package/dist/src/lib/actions/behaviors/ricochet/ricochet.d.ts.map +0 -1
- package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts +0 -2
- package/dist/src/lib/actions/behaviors/zylem-behavior.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/moveable.d.ts +0 -125
- package/dist/src/lib/actions/capabilities/moveable.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/rotatable.d.ts +0 -111
- package/dist/src/lib/actions/capabilities/rotatable.d.ts.map +0 -1
- package/dist/src/lib/actions/capabilities/transformable.d.ts +0 -7
- package/dist/src/lib/actions/capabilities/transformable.d.ts.map +0 -1
- package/dist/src/lib/actions/global-change.d.ts +0 -23
- package/dist/src/lib/actions/global-change.d.ts.map +0 -1
- package/dist/src/lib/camera/camera.d.ts +0 -16
- package/dist/src/lib/camera/camera.d.ts.map +0 -1
- package/dist/src/lib/camera/fixed-2d.d.ts +0 -32
- package/dist/src/lib/camera/fixed-2d.d.ts.map +0 -1
- package/dist/src/lib/camera/perspective.d.ts +0 -9
- package/dist/src/lib/camera/perspective.d.ts.map +0 -1
- package/dist/src/lib/camera/third-person.d.ts +0 -32
- package/dist/src/lib/camera/third-person.d.ts.map +0 -1
- package/dist/src/lib/camera/zylem-camera.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-builder.d.ts +0 -17
- package/dist/src/lib/collision/collision-builder.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-delegate.d.ts +0 -6
- package/dist/src/lib/collision/collision-delegate.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-group.d.ts +0 -11
- package/dist/src/lib/collision/collision-group.d.ts.map +0 -1
- package/dist/src/lib/collision/collision-mask.d.ts +0 -18
- package/dist/src/lib/collision/collision-mask.d.ts.map +0 -1
- package/dist/src/lib/collision/collision.d.ts +0 -19
- package/dist/src/lib/collision/collision.d.ts.map +0 -1
- package/dist/src/lib/collision/utils.d.ts +0 -15
- package/dist/src/lib/collision/utils.d.ts.map +0 -1
- package/dist/src/lib/collision/world.d.ts +0 -23
- package/dist/src/lib/collision/world.d.ts.map +0 -1
- package/dist/src/lib/core/asset-manager.d.ts +0 -2
- package/dist/src/lib/core/asset-manager.d.ts.map +0 -1
- package/dist/src/lib/core/base-node-life-cycle.d.ts +0 -54
- package/dist/src/lib/core/base-node-life-cycle.d.ts.map +0 -1
- package/dist/src/lib/core/base-node.d.ts +0 -36
- package/dist/src/lib/core/base-node.d.ts.map +0 -1
- package/dist/src/lib/core/blueprints.d.ts +0 -22
- package/dist/src/lib/core/blueprints.d.ts.map +0 -1
- package/dist/src/lib/core/entity-asset-loader.d.ts +0 -16
- package/dist/src/lib/core/entity-asset-loader.d.ts.map +0 -1
- package/dist/src/lib/core/errors.d.ts +0 -5
- package/dist/src/lib/core/errors.d.ts.map +0 -1
- package/dist/src/lib/core/flags.d.ts +0 -3
- package/dist/src/lib/core/flags.d.ts.map +0 -1
- package/dist/src/lib/core/index.d.ts +0 -5
- package/dist/src/lib/core/index.d.ts.map +0 -1
- package/dist/src/lib/core/interfaces.d.ts +0 -25
- package/dist/src/lib/core/interfaces.d.ts.map +0 -1
- package/dist/src/lib/core/lazy-loader.d.ts +0 -80
- package/dist/src/lib/core/lazy-loader.d.ts.map +0 -1
- package/dist/src/lib/core/lifecycle-base.d.ts +0 -17
- package/dist/src/lib/core/lifecycle-base.d.ts.map +0 -1
- package/dist/src/lib/core/node-interface.d.ts +0 -12
- package/dist/src/lib/core/node-interface.d.ts.map +0 -1
- package/dist/src/lib/core/preset-shader.d.ts +0 -8
- package/dist/src/lib/core/preset-shader.d.ts.map +0 -1
- package/dist/src/lib/core/three-addons/Timer.d.ts +0 -92
- package/dist/src/lib/core/three-addons/Timer.d.ts.map +0 -1
- package/dist/src/lib/core/utility/nodes.d.ts +0 -13
- package/dist/src/lib/core/utility/nodes.d.ts.map +0 -1
- package/dist/src/lib/core/utility/strings.d.ts +0 -3
- package/dist/src/lib/core/utility/strings.d.ts.map +0 -1
- package/dist/src/lib/core/utility/vector.d.ts +0 -8
- package/dist/src/lib/core/utility/vector.d.ts.map +0 -1
- package/dist/src/lib/core/vector.d.ts +0 -4
- package/dist/src/lib/core/vector.d.ts.map +0 -1
- package/dist/src/lib/core/vessel.d.ts +0 -13
- package/dist/src/lib/core/vessel.d.ts.map +0 -1
- package/dist/src/lib/debug/console/console-state.d.ts +0 -20
- package/dist/src/lib/debug/console/console-state.d.ts.map +0 -1
- package/dist/src/lib/debug/console/console-store.d.ts +0 -6
- package/dist/src/lib/debug/console/console-store.d.ts.map +0 -1
- package/dist/src/lib/debug/debug-state.d.ts +0 -38
- package/dist/src/lib/debug/debug-state.d.ts.map +0 -1
- package/dist/src/lib/debug/debug-store.d.ts +0 -15
- package/dist/src/lib/debug/debug-store.d.ts.map +0 -1
- package/dist/src/lib/debug/state-based-debug-loader.d.ts +0 -8
- package/dist/src/lib/debug/state-based-debug-loader.d.ts.map +0 -1
- package/dist/src/lib/device/aspect-ratio.d.ts +0 -38
- package/dist/src/lib/device/aspect-ratio.d.ts.map +0 -1
- package/dist/src/lib/device/desktop.d.ts +0 -2
- package/dist/src/lib/device/desktop.d.ts.map +0 -1
- package/dist/src/lib/device/mobile.d.ts +0 -2
- package/dist/src/lib/device/mobile.d.ts.map +0 -1
- package/dist/src/lib/device/tablet.d.ts +0 -2
- package/dist/src/lib/device/tablet.d.ts.map +0 -1
- package/dist/src/lib/entities/actor.d.ts +0 -44
- package/dist/src/lib/entities/actor.d.ts.map +0 -1
- package/dist/src/lib/entities/box.d.ts +0 -27
- package/dist/src/lib/entities/box.d.ts.map +0 -1
- package/dist/src/lib/entities/builder.d.ts +0 -28
- package/dist/src/lib/entities/builder.d.ts.map +0 -1
- package/dist/src/lib/entities/create.d.ts +0 -15
- package/dist/src/lib/entities/create.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/animation.d.ts +0 -33
- package/dist/src/lib/entities/delegates/animation.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/debug.d.ts +0 -29
- package/dist/src/lib/entities/delegates/debug.d.ts.map +0 -1
- package/dist/src/lib/entities/delegates/loader.d.ts +0 -12
- package/dist/src/lib/entities/delegates/loader.d.ts.map +0 -1
- package/dist/src/lib/entities/destroy.d.ts +0 -4
- package/dist/src/lib/entities/destroy.d.ts.map +0 -1
- package/dist/src/lib/entities/entity-factory.d.ts +0 -10
- package/dist/src/lib/entities/entity-factory.d.ts.map +0 -1
- package/dist/src/lib/entities/entity.d.ts +0 -98
- package/dist/src/lib/entities/entity.d.ts.map +0 -1
- package/dist/src/lib/entities/index.d.ts +0 -12
- package/dist/src/lib/entities/index.d.ts.map +0 -1
- package/dist/src/lib/entities/plane.d.ts +0 -36
- package/dist/src/lib/entities/plane.d.ts.map +0 -1
- package/dist/src/lib/entities/rect.d.ts +0 -63
- package/dist/src/lib/entities/rect.d.ts.map +0 -1
- package/dist/src/lib/entities/sphere.d.ts +0 -29
- package/dist/src/lib/entities/sphere.d.ts.map +0 -1
- package/dist/src/lib/entities/sprite.d.ts +0 -54
- package/dist/src/lib/entities/sprite.d.ts.map +0 -1
- package/dist/src/lib/entities/text.d.ts +0 -49
- package/dist/src/lib/entities/text.d.ts.map +0 -1
- package/dist/src/lib/entities/zone.d.ts +0 -54
- package/dist/src/lib/entities/zone.d.ts.map +0 -1
- package/dist/src/lib/game/game-blueprint.d.ts +0 -38
- package/dist/src/lib/game/game-blueprint.d.ts.map +0 -1
- package/dist/src/lib/game/game-canvas.d.ts +0 -35
- package/dist/src/lib/game/game-canvas.d.ts.map +0 -1
- package/dist/src/lib/game/game-config.d.ts +0 -59
- package/dist/src/lib/game/game-config.d.ts.map +0 -1
- package/dist/src/lib/game/game-default.d.ts +0 -14
- package/dist/src/lib/game/game-default.d.ts.map +0 -1
- package/dist/src/lib/game/game-interfaces.d.ts +0 -29
- package/dist/src/lib/game/game-interfaces.d.ts.map +0 -1
- package/dist/src/lib/game/game-retro-resolutions.d.ts +0 -25
- package/dist/src/lib/game/game-retro-resolutions.d.ts.map +0 -1
- package/dist/src/lib/game/game-state.d.ts +0 -11
- package/dist/src/lib/game/game-state.d.ts.map +0 -1
- package/dist/src/lib/game/game.d.ts +0 -39
- package/dist/src/lib/game/game.d.ts.map +0 -1
- package/dist/src/lib/game/zylem-game.d.ts +0 -58
- package/dist/src/lib/game/zylem-game.d.ts.map +0 -1
- package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts +0 -8
- package/dist/src/lib/graphics/geometries/XZPlaneGeometry.d.ts.map +0 -1
- package/dist/src/lib/graphics/material.d.ts +0 -29
- package/dist/src/lib/graphics/material.d.ts.map +0 -1
- package/dist/src/lib/graphics/mesh.d.ts +0 -19
- package/dist/src/lib/graphics/mesh.d.ts.map +0 -1
- package/dist/src/lib/graphics/render-pass.d.ts +0 -17
- package/dist/src/lib/graphics/render-pass.d.ts.map +0 -1
- package/dist/src/lib/graphics/zylem-scene.d.ts +0 -50
- package/dist/src/lib/graphics/zylem-scene.d.ts.map +0 -1
- package/dist/src/lib/input/gamepad-provider.d.ts +0 -14
- package/dist/src/lib/input/gamepad-provider.d.ts.map +0 -1
- package/dist/src/lib/input/input-manager.d.ts +0 -15
- package/dist/src/lib/input/input-manager.d.ts.map +0 -1
- package/dist/src/lib/input/input-provider.d.ts +0 -7
- package/dist/src/lib/input/input-provider.d.ts.map +0 -1
- package/dist/src/lib/input/input.d.ts +0 -48
- package/dist/src/lib/input/input.d.ts.map +0 -1
- package/dist/src/lib/input/keyboard-provider.d.ts +0 -21
- package/dist/src/lib/input/keyboard-provider.d.ts.map +0 -1
- package/dist/src/lib/interfaces/entity.d.ts +0 -26
- package/dist/src/lib/interfaces/entity.d.ts.map +0 -1
- package/dist/src/lib/sounds/index.d.ts +0 -3
- package/dist/src/lib/sounds/index.d.ts.map +0 -1
- package/dist/src/lib/sounds/ping-pong-sound.d.ts +0 -5
- package/dist/src/lib/sounds/ping-pong-sound.d.ts.map +0 -1
- package/dist/src/lib/sounds/ricochet-sound.d.ts +0 -5
- package/dist/src/lib/sounds/ricochet-sound.d.ts.map +0 -1
- package/dist/src/lib/stage/debug-entity-cursor.d.ts +0 -24
- package/dist/src/lib/stage/debug-entity-cursor.d.ts.map +0 -1
- package/dist/src/lib/stage/entity-spawner.d.ts +0 -9
- package/dist/src/lib/stage/entity-spawner.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts +0 -14
- package/dist/src/lib/stage/stage-camera-debug-delegate.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-debug-delegate.d.ts +0 -26
- package/dist/src/lib/stage/stage-debug-delegate.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-default.d.ts +0 -3
- package/dist/src/lib/stage/stage-default.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-factory.d.ts +0 -6
- package/dist/src/lib/stage/stage-factory.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-manager.d.ts +0 -30
- package/dist/src/lib/stage/stage-manager.d.ts.map +0 -1
- package/dist/src/lib/stage/stage-state.d.ts +0 -14
- package/dist/src/lib/stage/stage-state.d.ts.map +0 -1
- package/dist/src/lib/stage/stage.d.ts +0 -35
- package/dist/src/lib/stage/stage.d.ts.map +0 -1
- package/dist/src/lib/stage/zylem-stage.d.ts +0 -128
- package/dist/src/lib/stage/zylem-stage.d.ts.map +0 -1
- package/dist/src/lib/systems/test-system.d.ts +0 -2
- package/dist/src/lib/systems/test-system.d.ts.map +0 -1
- package/dist/src/lib/systems/transformable.system.d.ts +0 -25
- package/dist/src/lib/systems/transformable.system.d.ts.map +0 -1
- package/dist/src/lib/types/entity-types.d.ts +0 -24
- package/dist/src/lib/types/entity-types.d.ts.map +0 -1
- package/dist/src/lib/types/index.d.ts +0 -3
- package/dist/src/lib/types/index.d.ts.map +0 -1
- package/dist/src/lib/types/stage-types.d.ts +0 -26
- package/dist/src/lib/types/stage-types.d.ts.map +0 -1
- package/dist/src/lib/ui/Debug.d.ts +0 -6
- package/dist/src/lib/ui/Debug.d.ts.map +0 -1
- package/dist/src/lib/ui/console/Console.d.ts +0 -7
- package/dist/src/lib/ui/console/Console.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts +0 -7
- package/dist/src/lib/ui/debug-panel/AccordionMenu.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/Menu.d.ts +0 -6
- package/dist/src/lib/ui/debug-panel/Menu.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts +0 -4
- package/dist/src/lib/ui/debug-panel/sections/EntitiesSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts +0 -3
- package/dist/src/lib/ui/debug-panel/sections/GameSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts +0 -3
- package/dist/src/lib/ui/debug-panel/sections/StagesSection.d.ts.map +0 -1
- package/dist/src/lib/ui/debug-panel/sections/all.d.ts +0 -4
- package/dist/src/lib/ui/debug-panel/sections/all.d.ts.map +0 -1
- package/dist/src/lib/ui/toolbar/Toolbar.d.ts +0 -6
- package/dist/src/lib/ui/toolbar/Toolbar.d.ts.map +0 -1
- package/dist/tests/e2e/basic-game.spec.d.ts +0 -2
- package/dist/tests/e2e/basic-game.spec.d.ts.map +0 -1
- package/dist/tests/integration/debug.sim.spec.d.ts +0 -2
- package/dist/tests/integration/debug.sim.spec.d.ts.map +0 -1
- package/dist/tests/unit/collision/collision.spec.d.ts +0 -2
- package/dist/tests/unit/collision/collision.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/base-node.spec.d.ts +0 -2
- package/dist/tests/unit/core/base-node.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/game.spec.d.ts +0 -2
- package/dist/tests/unit/core/game.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/stage.spec.d.ts +0 -2
- package/dist/tests/unit/core/stage.spec.d.ts.map +0 -1
- package/dist/tests/unit/core/vessel.spec.d.ts +0 -2
- package/dist/tests/unit/core/vessel.spec.d.ts.map +0 -1
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { I as InputGamepad, b as UpdateFunction, f as InputPlayerNumber, g as Inputs, h as ButtonState, A as AnalogState, c as SetupContext, U as UpdateContext, d as DestroyContext, i as GameEntityLifeCycle, e as BaseNode, j as IGame, S as SetupFunction, D as DestroyFunction, L as LoadingEvent, k as LoadedContext, C as CleanupContext } from './entity-bQElAdpo.js';
|
|
2
|
+
import { Z as ZylemCamera } from './camera-Dk-fOVZE.js';
|
|
3
|
+
import { B as BaseEntityInterface, a as Stage } from './stage-CrmY7V0i.js';
|
|
4
|
+
import { Color, Vector3 } from 'three';
|
|
5
|
+
import { Vector3 as Vector3$1 } from '@dimforge/rapier3d-compat';
|
|
6
|
+
|
|
7
|
+
interface InputProvider {
|
|
8
|
+
getInput(delta: number): Partial<InputGamepad>;
|
|
9
|
+
isConnected(): boolean;
|
|
10
|
+
getName(): string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type BasicTypes = number | string | boolean;
|
|
14
|
+
type BaseGlobals = Record<string, BasicTypes>;
|
|
15
|
+
type KeyboardMapping = Record<string, string[]>;
|
|
16
|
+
type MouseMapping = Record<string, string[]>;
|
|
17
|
+
interface GameInputPlayerConfig {
|
|
18
|
+
key?: KeyboardMapping;
|
|
19
|
+
mouse?: MouseMapping;
|
|
20
|
+
}
|
|
21
|
+
interface GameInputConfig {
|
|
22
|
+
p1?: GameInputPlayerConfig;
|
|
23
|
+
p2?: GameInputPlayerConfig;
|
|
24
|
+
p3?: GameInputPlayerConfig;
|
|
25
|
+
p4?: GameInputPlayerConfig;
|
|
26
|
+
p5?: GameInputPlayerConfig;
|
|
27
|
+
p6?: GameInputPlayerConfig;
|
|
28
|
+
p7?: GameInputPlayerConfig;
|
|
29
|
+
p8?: GameInputPlayerConfig;
|
|
30
|
+
}
|
|
31
|
+
interface ZylemGameConfig<StageInterface, GameInterface, TGlobals extends BaseGlobals> {
|
|
32
|
+
id: string;
|
|
33
|
+
globals?: TGlobals;
|
|
34
|
+
stages?: StageInterface[];
|
|
35
|
+
update?: UpdateFunction<GameInterface>;
|
|
36
|
+
debug?: boolean;
|
|
37
|
+
time?: number;
|
|
38
|
+
input?: GameInputConfig;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare class InputManager {
|
|
42
|
+
private inputMap;
|
|
43
|
+
private currentInputs;
|
|
44
|
+
private previousInputs;
|
|
45
|
+
constructor(config?: GameInputConfig);
|
|
46
|
+
addInputProvider(playerNumber: InputPlayerNumber, provider: InputProvider): void;
|
|
47
|
+
getInputs(delta: number): Inputs;
|
|
48
|
+
mergeButtonState(a: ButtonState | undefined, b: ButtonState | undefined): ButtonState;
|
|
49
|
+
mergeAnalogState(a: AnalogState | undefined, b: AnalogState | undefined): AnalogState;
|
|
50
|
+
private mergeInputs;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This class is an alternative to {@link Clock} with a different API design and behavior.
|
|
55
|
+
* The goal is to avoid the conceptual flaws that became apparent in `Clock` over time.
|
|
56
|
+
*
|
|
57
|
+
* - `Timer` has an `update()` method that updates its internal state. That makes it possible to
|
|
58
|
+
* call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values.
|
|
59
|
+
* - The class can make use of the Page Visibility API to avoid large time delta values when the app
|
|
60
|
+
* is inactive (e.g. tab switched or browser hidden).
|
|
61
|
+
*
|
|
62
|
+
* ```js
|
|
63
|
+
* const timer = new Timer();
|
|
64
|
+
* timer.connect( document ); // use Page Visibility API
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @three_import import { Timer } from 'three/addons/misc/Timer.js';
|
|
68
|
+
*/
|
|
69
|
+
declare class Timer {
|
|
70
|
+
protected _previousTime: number;
|
|
71
|
+
protected _currentTime: number;
|
|
72
|
+
protected _startTime: number;
|
|
73
|
+
protected _delta: number;
|
|
74
|
+
protected _elapsed: number;
|
|
75
|
+
protected _timescale: number;
|
|
76
|
+
protected _document: Document | null;
|
|
77
|
+
protected _pageVisibilityHandler: (() => void) | null;
|
|
78
|
+
/**
|
|
79
|
+
* Constructs a new timer.
|
|
80
|
+
*/
|
|
81
|
+
constructor();
|
|
82
|
+
/**
|
|
83
|
+
* Connect the timer to the given document.Calling this method is not mandatory to
|
|
84
|
+
* use the timer but enables the usage of the Page Visibility API to avoid large time
|
|
85
|
+
* delta values.
|
|
86
|
+
*
|
|
87
|
+
* @param {Document} document - The document.
|
|
88
|
+
*/
|
|
89
|
+
connect(document: Document): void;
|
|
90
|
+
/**
|
|
91
|
+
* Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
|
|
92
|
+
*/
|
|
93
|
+
disconnect(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the time delta in seconds.
|
|
96
|
+
*
|
|
97
|
+
* @return {number} The time delta in second.
|
|
98
|
+
*/
|
|
99
|
+
getDelta(): number;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the elapsed time in seconds.
|
|
102
|
+
*
|
|
103
|
+
* @return {number} The elapsed time in second.
|
|
104
|
+
*/
|
|
105
|
+
getElapsed(): number;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the timescale.
|
|
108
|
+
*
|
|
109
|
+
* @return {number} The timescale.
|
|
110
|
+
*/
|
|
111
|
+
getTimescale(): number;
|
|
112
|
+
/**
|
|
113
|
+
* Sets the given timescale which scale the time delta computation
|
|
114
|
+
* in `update()`.
|
|
115
|
+
*
|
|
116
|
+
* @param {number} timescale - The timescale to set.
|
|
117
|
+
* @return {Timer} A reference to this timer.
|
|
118
|
+
*/
|
|
119
|
+
setTimescale(timescale: number): Timer;
|
|
120
|
+
/**
|
|
121
|
+
* Resets the time computation for the current simulation step.
|
|
122
|
+
*
|
|
123
|
+
* @return {Timer} A reference to this timer.
|
|
124
|
+
*/
|
|
125
|
+
reset(): Timer;
|
|
126
|
+
/**
|
|
127
|
+
* Can be used to free all internal resources. Usually called when
|
|
128
|
+
* the timer instance isn't required anymore.
|
|
129
|
+
*/
|
|
130
|
+
dispose(): void;
|
|
131
|
+
/**
|
|
132
|
+
* Updates the internal state of the timer. This method should be called
|
|
133
|
+
* once per simulation step and before you perform queries against the timer
|
|
134
|
+
* (e.g. via `getDelta()`).
|
|
135
|
+
*
|
|
136
|
+
* @param {number} timestamp - The current time in milliseconds. Can be obtained
|
|
137
|
+
* from the `requestAnimationFrame` callback argument. If not provided, the current
|
|
138
|
+
* time will be determined with `performance.now`.
|
|
139
|
+
* @return {Timer} A reference to this timer.
|
|
140
|
+
*/
|
|
141
|
+
update(timestamp?: number): Timer;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Stage state interface - minimal to prevent circular dependencies
|
|
146
|
+
*/
|
|
147
|
+
interface StageStateInterface {
|
|
148
|
+
backgroundColor: Color;
|
|
149
|
+
backgroundImage: string | null;
|
|
150
|
+
inputs: {
|
|
151
|
+
p1: string[];
|
|
152
|
+
p2: string[];
|
|
153
|
+
};
|
|
154
|
+
variables: Record<string, any>;
|
|
155
|
+
gravity: Vector3;
|
|
156
|
+
entities: Partial<BaseEntityInterface>[];
|
|
157
|
+
stageRef?: any;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Minimal stage interface to break circular dependencies
|
|
161
|
+
*/
|
|
162
|
+
interface StageInterface {
|
|
163
|
+
uuid: string;
|
|
164
|
+
children: any[];
|
|
165
|
+
state: StageStateInterface;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare const AspectRatio: {
|
|
169
|
+
readonly FourByThree: number;
|
|
170
|
+
readonly SixteenByNine: number;
|
|
171
|
+
readonly TwentyOneByNine: number;
|
|
172
|
+
readonly OneByOne: number;
|
|
173
|
+
};
|
|
174
|
+
type AspectRatioValue = (typeof AspectRatio)[keyof typeof AspectRatio] | number;
|
|
175
|
+
/**
|
|
176
|
+
* AspectRatioDelegate manages sizing a canvas to fit within a container
|
|
177
|
+
* while preserving a target aspect ratio. It notifies a consumer via
|
|
178
|
+
* onResize when the final width/height are applied so renderers/cameras
|
|
179
|
+
* can update their viewports.
|
|
180
|
+
*/
|
|
181
|
+
declare class AspectRatioDelegate {
|
|
182
|
+
container: HTMLElement;
|
|
183
|
+
canvas: HTMLCanvasElement;
|
|
184
|
+
aspectRatio: number;
|
|
185
|
+
onResize?: (width: number, height: number) => void;
|
|
186
|
+
private handleResizeBound;
|
|
187
|
+
constructor(params: {
|
|
188
|
+
container: HTMLElement;
|
|
189
|
+
canvas: HTMLCanvasElement;
|
|
190
|
+
aspectRatio: AspectRatioValue;
|
|
191
|
+
onResize?: (width: number, height: number) => void;
|
|
192
|
+
});
|
|
193
|
+
/** Attach window resize listener and apply once. */
|
|
194
|
+
attach(): void;
|
|
195
|
+
/** Detach window resize listener. */
|
|
196
|
+
detach(): void;
|
|
197
|
+
/** Compute the largest size that fits container while preserving aspect. */
|
|
198
|
+
measure(): {
|
|
199
|
+
width: number;
|
|
200
|
+
height: number;
|
|
201
|
+
};
|
|
202
|
+
/** Apply measured size to canvas and notify. */
|
|
203
|
+
apply(): void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
type RetroResolution = {
|
|
207
|
+
key: string;
|
|
208
|
+
width: number;
|
|
209
|
+
height: number;
|
|
210
|
+
notes?: string;
|
|
211
|
+
};
|
|
212
|
+
type RetroPreset = {
|
|
213
|
+
displayAspect: number;
|
|
214
|
+
resolutions: RetroResolution[];
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Retro and console display presets.
|
|
218
|
+
* displayAspect represents the intended display aspect (letterboxing target),
|
|
219
|
+
* not necessarily the raw pixel aspect of internal buffers.
|
|
220
|
+
*/
|
|
221
|
+
declare const RetroPresets: Record<string, RetroPreset>;
|
|
222
|
+
type RetroPresetKey = keyof typeof RetroPresets;
|
|
223
|
+
|
|
224
|
+
type GameConfigLike = Partial<{
|
|
225
|
+
id: string;
|
|
226
|
+
globals: Record<string, any>;
|
|
227
|
+
stages: StageInterface[];
|
|
228
|
+
debug: boolean;
|
|
229
|
+
time: number;
|
|
230
|
+
input: GameInputConfig;
|
|
231
|
+
/** numeric value or key in AspectRatio */
|
|
232
|
+
aspectRatio: AspectRatioValue | keyof typeof AspectRatio;
|
|
233
|
+
/** console/display preset to derive aspect ratio */
|
|
234
|
+
preset: RetroPresetKey;
|
|
235
|
+
/** lock internal render buffer to this resolution (e.g., '256x240' or { width, height }) */
|
|
236
|
+
resolution: string | {
|
|
237
|
+
width: number;
|
|
238
|
+
height: number;
|
|
239
|
+
};
|
|
240
|
+
fullscreen: boolean;
|
|
241
|
+
/** CSS background value for document body */
|
|
242
|
+
bodyBackground: string;
|
|
243
|
+
/** existing container by reference */
|
|
244
|
+
container: HTMLElement;
|
|
245
|
+
/** create/find container by id */
|
|
246
|
+
containerId: string;
|
|
247
|
+
/** optional canvas if caller wants to manage it */
|
|
248
|
+
canvas: HTMLCanvasElement;
|
|
249
|
+
}>;
|
|
250
|
+
declare class GameConfig {
|
|
251
|
+
id: string;
|
|
252
|
+
globals: Record<string, any>;
|
|
253
|
+
stages: StageInterface[];
|
|
254
|
+
debug: boolean;
|
|
255
|
+
time: number;
|
|
256
|
+
input: GameInputConfig | undefined;
|
|
257
|
+
aspectRatio: number;
|
|
258
|
+
internalResolution: {
|
|
259
|
+
width: number;
|
|
260
|
+
height: number;
|
|
261
|
+
} | undefined;
|
|
262
|
+
fullscreen: boolean;
|
|
263
|
+
bodyBackground: string | undefined;
|
|
264
|
+
container: HTMLElement;
|
|
265
|
+
containerId?: string | undefined;
|
|
266
|
+
canvas?: HTMLCanvasElement | undefined;
|
|
267
|
+
constructor(id: string, globals: Record<string, any>, stages: StageInterface[], debug: boolean, time: number, input: GameInputConfig | undefined, aspectRatio: number, internalResolution: {
|
|
268
|
+
width: number;
|
|
269
|
+
height: number;
|
|
270
|
+
} | undefined, fullscreen: boolean, bodyBackground: string | undefined, container: HTMLElement, containerId?: string | undefined, canvas?: HTMLCanvasElement | undefined);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Factory for authoring configuration objects in user code.
|
|
274
|
+
* Returns a plain object that can be passed to `game(...)`.
|
|
275
|
+
*/
|
|
276
|
+
declare function gameConfig(config: GameConfigLike): GameConfigLike;
|
|
277
|
+
|
|
278
|
+
interface GameCanvasOptions {
|
|
279
|
+
id: string;
|
|
280
|
+
container?: HTMLElement;
|
|
281
|
+
containerId?: string;
|
|
282
|
+
canvas?: HTMLCanvasElement;
|
|
283
|
+
bodyBackground?: string;
|
|
284
|
+
fullscreen?: boolean;
|
|
285
|
+
aspectRatio: AspectRatioValue | number;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* GameCanvas is a DOM delegate that owns:
|
|
289
|
+
* - container lookup/creation and styling (including fullscreen centering)
|
|
290
|
+
* - body background application
|
|
291
|
+
* - canvas mounting into container
|
|
292
|
+
* - aspect ratio sizing via AspectRatioDelegate
|
|
293
|
+
*/
|
|
294
|
+
declare class GameCanvas {
|
|
295
|
+
id: string;
|
|
296
|
+
container: HTMLElement;
|
|
297
|
+
canvas: HTMLCanvasElement;
|
|
298
|
+
bodyBackground?: string;
|
|
299
|
+
fullscreen: boolean;
|
|
300
|
+
aspectRatio: number;
|
|
301
|
+
private ratioDelegate;
|
|
302
|
+
constructor(options: GameCanvasOptions);
|
|
303
|
+
applyBodyBackground(): void;
|
|
304
|
+
mountCanvas(): void;
|
|
305
|
+
mountRenderer(rendererDom: HTMLCanvasElement, onResize: (width: number, height: number) => void): void;
|
|
306
|
+
centerIfFullscreen(): void;
|
|
307
|
+
attachAspectRatio(onResize: (width: number, height: number) => void): void;
|
|
308
|
+
destroy(): void;
|
|
309
|
+
private ensureContainer;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
type ZylemGameOptions<TGlobals extends BaseGlobals> = ZylemGameConfig<Stage, ZylemGame<TGlobals>, TGlobals> & Partial<GameConfig>;
|
|
313
|
+
declare class ZylemGame<TGlobals extends BaseGlobals> {
|
|
314
|
+
id: string;
|
|
315
|
+
initialGlobals: TGlobals;
|
|
316
|
+
customSetup: ((params: SetupContext<ZylemGame<TGlobals>, TGlobals>) => void) | null;
|
|
317
|
+
customUpdate: ((params: UpdateContext<ZylemGame<TGlobals>, TGlobals>) => void) | null;
|
|
318
|
+
customDestroy: ((params: DestroyContext<ZylemGame<TGlobals>, TGlobals>) => void) | null;
|
|
319
|
+
stages: Stage[];
|
|
320
|
+
stageMap: Map<string, Stage>;
|
|
321
|
+
currentStageId: string;
|
|
322
|
+
previousTimeStamp: number;
|
|
323
|
+
totalTime: number;
|
|
324
|
+
timer: Timer;
|
|
325
|
+
inputManager: InputManager;
|
|
326
|
+
wrapperRef: Game<TGlobals>;
|
|
327
|
+
statsRef: {
|
|
328
|
+
begin: () => void;
|
|
329
|
+
end: () => void;
|
|
330
|
+
showPanel: (panel: number) => void;
|
|
331
|
+
dom: HTMLElement;
|
|
332
|
+
} | null;
|
|
333
|
+
defaultCamera: ZylemCamera | null;
|
|
334
|
+
container: HTMLElement | null;
|
|
335
|
+
canvas: HTMLCanvasElement | null;
|
|
336
|
+
aspectRatioDelegate: AspectRatioDelegate | null;
|
|
337
|
+
resolvedConfig: GameConfig | null;
|
|
338
|
+
gameCanvas: GameCanvas | null;
|
|
339
|
+
private animationFrameId;
|
|
340
|
+
private isDisposed;
|
|
341
|
+
static FRAME_LIMIT: number;
|
|
342
|
+
static FRAME_DURATION: number;
|
|
343
|
+
static MAX_DELTA_SECONDS: number;
|
|
344
|
+
constructor(options: ZylemGameOptions<TGlobals>, wrapperRef: Game<TGlobals>);
|
|
345
|
+
loadGameCanvas(config: GameConfig): void;
|
|
346
|
+
loadDebugOptions(options: ZylemGameOptions<TGlobals>): void;
|
|
347
|
+
loadStage(stage: Stage): Promise<void>;
|
|
348
|
+
unloadCurrentStage(): void;
|
|
349
|
+
setGlobals(options: ZylemGameConfig<Stage, ZylemGame<TGlobals>, TGlobals>): void;
|
|
350
|
+
params(): UpdateContext<ZylemGame<TGlobals>, TGlobals>;
|
|
351
|
+
start(): void;
|
|
352
|
+
loop(timestamp: number): void;
|
|
353
|
+
dispose(): void;
|
|
354
|
+
outOfLoop(): void;
|
|
355
|
+
getStage(id: string): Stage | undefined;
|
|
356
|
+
currentStage(): Stage | undefined;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
type GameOptions<TGlobals extends BaseGlobals> = Array<ZylemGameConfig<Stage, any, TGlobals> | GameConfigLike | Stage | GameEntityLifeCycle | BaseNode>;
|
|
360
|
+
|
|
361
|
+
declare class Game<TGlobals extends BaseGlobals> implements IGame<TGlobals> {
|
|
362
|
+
private wrappedGame;
|
|
363
|
+
options: GameOptions<TGlobals>;
|
|
364
|
+
update: UpdateFunction<ZylemGame<TGlobals>, TGlobals>;
|
|
365
|
+
setup: SetupFunction<ZylemGame<TGlobals>, TGlobals>;
|
|
366
|
+
destroy: DestroyFunction<ZylemGame<TGlobals>, TGlobals>;
|
|
367
|
+
refErrorMessage: string;
|
|
368
|
+
constructor(options: GameOptions<TGlobals>);
|
|
369
|
+
start(): Promise<this>;
|
|
370
|
+
private load;
|
|
371
|
+
setOverrides(): void;
|
|
372
|
+
pause(): Promise<void>;
|
|
373
|
+
resume(): Promise<void>;
|
|
374
|
+
reset(): Promise<void>;
|
|
375
|
+
previousStage(): Promise<void>;
|
|
376
|
+
loadStageFromId(stageId: string): Promise<void>;
|
|
377
|
+
nextStage(): Promise<void>;
|
|
378
|
+
goToStage(): Promise<void>;
|
|
379
|
+
end(): Promise<void>;
|
|
380
|
+
dispose(): void;
|
|
381
|
+
onLoading(callback: (event: LoadingEvent) => void): void;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* create a new game
|
|
385
|
+
* @param options GameOptions - Array of IGameOptions, Stage, GameEntity, or BaseNode objects
|
|
386
|
+
* @param options.id Game name string (when using IGameOptions)
|
|
387
|
+
* @param options.globals Game globals object (when using IGameOptions)
|
|
388
|
+
* @param options.stages Array of stage objects (when using IGameOptions)
|
|
389
|
+
* @returns Game
|
|
390
|
+
*/
|
|
391
|
+
declare function createGame<TGlobals extends BaseGlobals>(...options: GameOptions<TGlobals>): Game<TGlobals>;
|
|
392
|
+
|
|
393
|
+
declare class Vessel extends BaseNode<{}, Vessel> {
|
|
394
|
+
static type: symbol;
|
|
395
|
+
protected _setup(_params: SetupContext<this>): void;
|
|
396
|
+
protected _loaded(_params: LoadedContext<this>): Promise<void>;
|
|
397
|
+
protected _update(_params: UpdateContext<this>): void;
|
|
398
|
+
protected _destroy(_params: DestroyContext<this>): void;
|
|
399
|
+
protected _cleanup(_params: CleanupContext<this>): Promise<void>;
|
|
400
|
+
create(): this;
|
|
401
|
+
}
|
|
402
|
+
declare function vessel(...args: Array<BaseNode>): BaseNode<{}, Vessel>;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* @deprecated This type is deprecated.
|
|
406
|
+
*/
|
|
407
|
+
type Vect3 = Vector3 | Vector3$1;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Listen for a single global key change inside an onUpdate pipeline.
|
|
411
|
+
* Usage: onUpdate(globalChange('p1Score', (value) => { ... }))
|
|
412
|
+
*/
|
|
413
|
+
declare function globalChange<T = any>(key: string, callback: (value: T, ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
414
|
+
/**
|
|
415
|
+
* Listen for multiple global key changes inside an onUpdate pipeline.
|
|
416
|
+
* Calls back when any of the provided keys changes.
|
|
417
|
+
* Usage: onUpdate(globalChanges(['p1Score','p2Score'], ([p1,p2]) => { ... }))
|
|
418
|
+
*/
|
|
419
|
+
declare function globalChanges<T = any>(keys: string[], callback: (values: T[], ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
420
|
+
/**
|
|
421
|
+
* Listen for a single stage variable change inside an onUpdate pipeline.
|
|
422
|
+
* Usage: onUpdate(variableChange('score', (value, ctx) => { ... }))
|
|
423
|
+
*/
|
|
424
|
+
declare function variableChange<T = any>(key: string, callback: (value: T, ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
425
|
+
/**
|
|
426
|
+
* Listen for multiple stage variable changes; fires when any changes.
|
|
427
|
+
* Usage: onUpdate(variableChanges(['a','b'], ([a,b], ctx) => { ... }))
|
|
428
|
+
*/
|
|
429
|
+
declare function variableChanges<T = any>(keys: string[], callback: (values: T[], ctx: UpdateContext<any>) => void): (ctx: UpdateContext<any>) => void;
|
|
430
|
+
|
|
431
|
+
export { Game as G, type Vect3 as V, type ZylemGameConfig as Z, globalChange as a, globalChanges as b, createGame as c, variableChange as d, variableChanges as e, gameConfig as g, vessel as v };
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { V as Vect3, Z as ZylemGameConfig, c as createGame, a as globalChange, b as globalChanges, d as variableChange, e as variableChanges, v as vessel } from './core-C2mjetAd.js';
|
|
2
|
+
import './entity-bQElAdpo.js';
|
|
3
|
+
import 'three';
|
|
4
|
+
import '@dimforge/rapier3d-compat';
|
|
5
|
+
import 'bitecs';
|
|
6
|
+
import './camera-Dk-fOVZE.js';
|
|
7
|
+
import 'three/addons/controls/OrbitControls.js';
|
|
8
|
+
import 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
9
|
+
import './stage-CrmY7V0i.js';
|