1681-engine 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/dist/1681-engine.js +463 -409
- package/dist/ambient/ColorGrade.js +0 -1
- package/dist/ambient/DayClock.js +0 -1
- package/dist/ambient/WeatherLayer.js +0 -1
- package/dist/ambient/grade.js +0 -1
- package/dist/ambient/weather.js +0 -1
- package/dist/anim/AnimStateMachine.js +0 -1
- package/dist/anim/Animator.js +0 -1
- package/dist/anim/animStateCompile.js +0 -1
- package/dist/anim/animStateSystem.js +0 -1
- package/dist/anim/animationSystem.js +0 -1
- package/dist/anim/asepriteSlices.js +0 -1
- package/dist/anim/asepriteTags.js +0 -1
- package/dist/anim/parseAseprite.js +0 -1
- package/dist/assets/AssetLoader.js +112 -14
- package/dist/assets/loadAseprite.js +0 -1
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +0 -1
- package/dist/assets/textureAtlas.js +58 -0
- package/dist/audio/Footsteps.js +0 -1
- package/dist/audio/MusicPlayer.js +0 -1
- package/dist/audio/SoundEngine.js +13 -7
- package/dist/audio/cleanTake.js +0 -1
- package/dist/audio/music/ElementVoice.js +0 -1
- package/dist/audio/music/GraphVoice.js +0 -1
- package/dist/audio/music/MusicChannel.js +0 -1
- package/dist/audio/music/musicVoice.js +0 -1
- package/dist/audio/sampleBank.js +0 -1
- package/dist/audio/soundTable.js +0 -1
- package/dist/audio/synth.js +0 -1
- package/dist/core/BitmapLabel.js +0 -1
- package/dist/core/Camera.js +1 -2
- package/dist/core/Clock.js +31 -21
- package/dist/core/Graphics.js +0 -1
- package/dist/core/Group.js +0 -1
- package/dist/core/Image.js +0 -1
- package/dist/core/ObjectFactory.js +0 -1
- package/dist/core/Pointer.js +46 -24
- package/dist/core/Rectangle.js +0 -1
- package/dist/core/Stage.js +5 -6
- package/dist/core/Text.js +0 -1
- package/dist/core/TextureRegistry.js +54 -24
- package/dist/core/Timeline.js +0 -1
- package/dist/core/TimelineBuilder.js +0 -1
- package/dist/core/TimelineChild.js +0 -1
- package/dist/core/Tweener.js +0 -1
- package/dist/core/atlas.js +0 -1
- package/dist/core/atlasPlan.js +0 -1
- package/dist/core/blendLayer.js +11 -0
- package/dist/core/eases.js +0 -1
- package/dist/core/gameObject.js +22 -20
- package/dist/core/pixelZoom.js +43 -0
- package/dist/core/pixiPatches.js +0 -1
- package/dist/core/runDue.js +28 -0
- package/dist/core/silhouette.js +49 -0
- package/dist/core/timelinePlace.js +0 -1
- package/dist/core/tweenProps.js +0 -1
- package/dist/debug/DebugOverlay.js +0 -1
- package/dist/debug/DrawCallCounter.js +15 -12
- package/dist/debug/ErrorLog.js +0 -1
- package/dist/debug/FrameStats.js +0 -1
- package/dist/debug/inspectWorld.js +0 -1
- package/dist/diagnostics/ErrorDeduper.js +0 -1
- package/dist/diagnostics/FrameSampler.js +0 -1
- package/dist/diagnostics/bootWatch.js +0 -1
- package/dist/diagnostics/captureErrors.js +0 -1
- package/dist/diagnostics/contextLoss.js +0 -1
- package/dist/diagnostics/frameStats.js +0 -1
- package/dist/diagnostics/gpuInfo.js +0 -1
- package/dist/diagnostics/renderGuard.js +0 -1
- package/dist/ecs/SparseSet.js +0 -1
- package/dist/ecs/World.js +0 -1
- package/dist/ecs/fields.js +0 -1
- package/dist/engine/Engine.js +42 -18
- package/dist/engine/FixedLoop.js +0 -1
- package/dist/engine/HiddenPause.js +27 -0
- package/dist/engine/Scene.js +0 -1
- package/dist/engine/SceneManager.js +0 -1
- package/dist/events/EventBus.js +0 -1
- package/dist/fx/Afterimages.js +82 -0
- package/dist/fx/FloatingText.js +0 -1
- package/dist/fx/hitStop.js +0 -1
- package/dist/fx/viewCull.js +0 -1
- package/dist/i18n/Translator.js +0 -1
- package/dist/i18n/extractStrings.js +0 -1
- package/dist/i18n/formatMessage.js +0 -1
- package/dist/input/Actions.js +29 -21
- package/dist/input/AimGesture.js +0 -1
- package/dist/input/Keyboard.js +0 -1
- package/dist/input/Keymap.js +0 -1
- package/dist/input/TargetLock.js +0 -1
- package/dist/input/aimAxis.js +0 -1
- package/dist/input/keyChord.js +0 -1
- package/dist/input/longPress.js +0 -1
- package/dist/input/rumble.js +42 -0
- package/dist/input/stickAxis.js +0 -1
- package/dist/input/touchDetect.js +0 -1
- package/dist/light/LightLayer.js +0 -1
- package/dist/nav/MinHeap.js +0 -1
- package/dist/nav/findPath.js +0 -1
- package/dist/nav/navGrid.js +0 -1
- package/dist/nav/nearestOpen.js +0 -1
- package/dist/nav/straightenPath.js +0 -1
- package/dist/net/Connection.js +39 -16
- package/dist/net/InterpolationBuffer.js +0 -1
- package/dist/net/PredictedMover.js +0 -1
- package/dist/net/Room.js +0 -1
- package/dist/net/RoomHost.js +0 -1
- package/dist/net/cadence.js +0 -1
- package/dist/net/constants.js +0 -1
- package/dist/net/lobby/LobbyClient.js +0 -1
- package/dist/net/lobby/LobbyHost.js +0 -1
- package/dist/net/lobby/LobbyRooms.js +0 -1
- package/dist/net/lobby/Matchmaker.js +0 -1
- package/dist/net/movement.js +40 -39
- package/dist/net/protocol.js +0 -1
- package/dist/net/reconnect.js +10 -0
- package/dist/net/serverClock.js +0 -1
- package/dist/net/snapshotCodec.js +0 -1
- package/dist/parallax/Parallax.js +0 -1
- package/dist/parallax/ParallaxLayer.js +0 -1
- package/dist/parallax/parallaxMath.js +0 -1
- package/dist/particles/Emitter.js +0 -1
- package/dist/particles/ParticleBudget.js +0 -1
- package/dist/particles/ParticleSim.js +0 -1
- package/dist/particles/particleCurves.js +0 -1
- package/dist/particles/particleSampling.js +0 -1
- package/dist/physics/Body.js +0 -1
- package/dist/physics/BroadPhase.js +0 -1
- package/dist/physics/Contact.js +0 -1
- package/dist/physics/ContactSolver.js +0 -1
- package/dist/physics/PhysicsWorld.js +0 -1
- package/dist/physics/SpatialHash.js +0 -1
- package/dist/physics/collide.js +0 -1
- package/dist/physics/collidePolygon.js +0 -1
- package/dist/physics/contactReport.js +0 -1
- package/dist/physics/drawColliders.js +0 -1
- package/dist/physics/physicsSystem.js +0 -1
- package/dist/physics/polygon.js +0 -1
- package/dist/physics/raycast.js +0 -1
- package/dist/physics/syncToBody.js +0 -1
- package/dist/physics/tileBodies.js +0 -1
- package/dist/physics/types.js +0 -1
- package/dist/pixel/Darkness.js +50 -47
- package/dist/pixel/DitherVignette.js +0 -1
- package/dist/pixel/Evaporation.js +0 -1
- package/dist/pixel/NightShade.js +0 -1
- package/dist/pixel/PixelLayer.js +0 -1
- package/dist/pixel/PixelMarks.js +99 -0
- package/dist/pixel/SwayProp.js +0 -1
- package/dist/pixel/aimPixels.js +67 -0
- package/dist/pixel/lights.js +0 -1
- package/dist/pixel/nineSlice.js +0 -1
- package/dist/pixel/paintLayer.js +0 -1
- package/dist/pixel/palette.js +0 -1
- package/dist/pixel/pixel.js +0 -1
- package/dist/pixel/pixelPaint.js +27 -24
- package/dist/pixel/pixelParticles.js +35 -0
- package/dist/pixel/pixelTone.js +0 -1
- package/dist/pixel/propKit.js +0 -1
- package/dist/pixel/ramp.js +0 -1
- package/dist/pixel/selout.js +0 -1
- package/dist/pixel/spritePixels.js +0 -1
- package/dist/pixel/swayRig.js +0 -1
- package/dist/pixel/vignetteMask.js +0 -1
- package/dist/pixel/weatherArt.js +0 -1
- package/dist/pixel.js +71 -65
- package/dist/platform/appResume.js +18 -0
- package/dist/platform/fullscreen.js +52 -0
- package/dist/platform/orientation.js +26 -0
- package/dist/platform/pointerLock.js +37 -0
- package/dist/platform/reducedMotion.js +23 -0
- package/dist/platform/timeoutSignal.js +14 -0
- package/dist/platform/touch.js +0 -1
- package/dist/postfx/BloomFilter.js +0 -1
- package/dist/postfx/ChromaticAberrationFilter.js +0 -1
- package/dist/postfx/ColorAdjustFilter.js +0 -1
- package/dist/postfx/CrtFilter.js +0 -1
- package/dist/postfx/PixelateFilter.js +0 -1
- package/dist/postfx/PostFx.js +0 -1
- package/dist/postfx/ShockwaveFilter.js +0 -1
- package/dist/postfx/VignetteFilter.js +0 -1
- package/dist/postfx/fxAnimator.js +0 -1
- package/dist/postfx/fxShader.js +0 -1
- package/dist/postfx.js +0 -1
- package/dist/react/ChoiceDialog.js +0 -1
- package/dist/react/ConfirmDialog.js +0 -1
- package/dist/react/Glyph.js +0 -1
- package/dist/react/Modal.js +0 -1
- package/dist/react/Panel.js +0 -1
- package/dist/react/PixelImage.js +0 -1
- package/dist/react/Select.js +0 -1
- package/dist/react/Slider.js +0 -1
- package/dist/react/SplitPane.js +0 -1
- package/dist/react/TabStrip.js +0 -1
- package/dist/react/TitleTips.js +0 -1
- package/dist/react/Tooltip.js +0 -1
- package/dist/react/UiProvider.js +0 -1
- package/dist/react/baseCss.js +0 -1
- package/dist/react/choiceStore.js +0 -1
- package/dist/react/classNames.js +0 -1
- package/dist/react/confirmStore.js +0 -1
- package/dist/react/labels.js +0 -1
- package/dist/react/placement.js +0 -1
- package/dist/react/useFillSheet.js +0 -1
- package/dist/react/useFitToViewport.js +0 -1
- package/dist/react/usePicked.js +0 -1
- package/dist/react/useStore.js +0 -1
- package/dist/react/useViewport.js +0 -1
- package/dist/react.js +0 -1
- package/dist/rig/PosePlayer.js +0 -1
- package/dist/rig/RigView.js +0 -1
- package/dist/rig/Skeleton.js +0 -1
- package/dist/rig/humanoid.js +0 -1
- package/dist/rig/humanoid.json.js +0 -1
- package/dist/rig/humanoidPoses.js +0 -1
- package/dist/rig/poseMath.js +0 -1
- package/dist/rig/poses.json.js +0 -1
- package/dist/save/Autosaver.js +0 -1
- package/dist/save/MemoryBackend.js +0 -1
- package/dist/save/SaveStore.js +0 -1
- package/dist/save/WebStorageBackend.js +0 -1
- package/dist/save/checksum.js +0 -1
- package/dist/save/migrateSave.js +0 -1
- package/dist/settings.js +0 -1
- package/dist/tilemap/TilemapView.js +0 -1
- package/dist/tilemap/collision.js +0 -1
- package/dist/tilemap/tiled.js +0 -1
- package/dist/transitions/CrossfadeTransition.js +0 -1
- package/dist/transitions/DitherWipeTransition.js +0 -1
- package/dist/transitions/FadeTransition.js +0 -1
- package/dist/transitions/Letterbox.js +0 -1
- package/dist/transitions/ditherMask.js +0 -1
- package/dist/transitions/transitionTo.js +0 -1
- package/dist/transitions/tweenDone.js +0 -1
- package/dist/types/assets/AssetLoader.d.ts +63 -8
- package/dist/types/assets/AssetLoader.d.ts.map +1 -1
- package/dist/types/assets/textureAtlas.d.ts +35 -0
- package/dist/types/assets/textureAtlas.d.ts.map +1 -0
- package/dist/types/audio/SoundEngine.d.ts +5 -0
- package/dist/types/audio/SoundEngine.d.ts.map +1 -1
- package/dist/types/core/Camera.d.ts +1 -1
- package/dist/types/core/Camera.d.ts.map +1 -1
- package/dist/types/core/Clock.d.ts +14 -2
- package/dist/types/core/Clock.d.ts.map +1 -1
- package/dist/types/core/Pointer.d.ts +18 -0
- package/dist/types/core/Pointer.d.ts.map +1 -1
- package/dist/types/core/Stage.d.ts.map +1 -1
- package/dist/types/core/TextureRegistry.d.ts +39 -0
- package/dist/types/core/TextureRegistry.d.ts.map +1 -1
- package/dist/types/core/blendLayer.d.ts +23 -0
- package/dist/types/core/blendLayer.d.ts.map +1 -0
- package/dist/types/core/gameObject.d.ts.map +1 -1
- package/dist/types/core/pixelZoom.d.ts +45 -0
- package/dist/types/core/pixelZoom.d.ts.map +1 -0
- package/dist/types/core/runDue.d.ts +15 -0
- package/dist/types/core/runDue.d.ts.map +1 -0
- package/dist/types/core/silhouette.d.ts +16 -0
- package/dist/types/core/silhouette.d.ts.map +1 -0
- package/dist/types/debug/DrawCallCounter.d.ts.map +1 -1
- package/dist/types/engine/Engine.d.ts +16 -0
- package/dist/types/engine/Engine.d.ts.map +1 -1
- package/dist/types/engine/HiddenPause.d.ts +22 -0
- package/dist/types/engine/HiddenPause.d.ts.map +1 -0
- package/dist/types/fx/Afterimages.d.ts +62 -0
- package/dist/types/fx/Afterimages.d.ts.map +1 -0
- package/dist/types/index.d.ts +18 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/input/Actions.d.ts +7 -1
- package/dist/types/input/Actions.d.ts.map +1 -1
- package/dist/types/input/rumble.d.ts +41 -0
- package/dist/types/input/rumble.d.ts.map +1 -0
- package/dist/types/net/Connection.d.ts +22 -0
- package/dist/types/net/Connection.d.ts.map +1 -1
- package/dist/types/net/constants.d.ts +13 -4
- package/dist/types/net/constants.d.ts.map +1 -1
- package/dist/types/net/movement.d.ts.map +1 -1
- package/dist/types/net/reconnect.d.ts +14 -0
- package/dist/types/net/reconnect.d.ts.map +1 -0
- package/dist/types/pixel/Darkness.d.ts +17 -5
- package/dist/types/pixel/Darkness.d.ts.map +1 -1
- package/dist/types/pixel/PixelMarks.d.ts +68 -0
- package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
- package/dist/types/pixel/aimPixels.d.ts +23 -0
- package/dist/types/pixel/aimPixels.d.ts.map +1 -0
- package/dist/types/pixel/index.d.ts +3 -1
- package/dist/types/pixel/index.d.ts.map +1 -1
- package/dist/types/pixel/pixelPaint.d.ts +1 -0
- package/dist/types/pixel/pixelPaint.d.ts.map +1 -1
- package/dist/types/pixel/pixelParticles.d.ts +21 -0
- package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
- package/dist/types/platform/appResume.d.ts +25 -0
- package/dist/types/platform/appResume.d.ts.map +1 -0
- package/dist/types/platform/fullscreen.d.ts +37 -0
- package/dist/types/platform/fullscreen.d.ts.map +1 -0
- package/dist/types/platform/orientation.d.ts +19 -0
- package/dist/types/platform/orientation.d.ts.map +1 -0
- package/dist/types/platform/pointerLock.d.ts +26 -0
- package/dist/types/platform/pointerLock.d.ts.map +1 -0
- package/dist/types/platform/reducedMotion.d.ts +20 -0
- package/dist/types/platform/reducedMotion.d.ts.map +1 -0
- package/dist/types/platform/timeoutSignal.d.ts +6 -0
- package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +4 -0
- package/dist/types/ui/index.d.ts.map +1 -1
- package/dist/types/ui/rich/RichText.d.ts +48 -0
- package/dist/types/ui/rich/RichText.d.ts.map +1 -0
- package/dist/types/ui/rich/richFonts.d.ts +70 -0
- package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
- package/dist/types/ui/rich/richLayout.d.ts +76 -0
- package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
- package/dist/types/ui/rich/richMarkup.d.ts +48 -0
- package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
- package/dist/ui/Bar.js +0 -1
- package/dist/ui/Button.js +0 -1
- package/dist/ui/Dialog.js +0 -1
- package/dist/ui/FocusManager.js +0 -1
- package/dist/ui/Label.js +0 -1
- package/dist/ui/List.js +0 -1
- package/dist/ui/Panel.js +0 -1
- package/dist/ui/ScrollView.js +0 -1
- package/dist/ui/Slider.js +0 -1
- package/dist/ui/Stack.js +0 -1
- package/dist/ui/Toggle.js +0 -1
- package/dist/ui/UiHost.js +0 -1
- package/dist/ui/UiPointerGate.js +0 -1
- package/dist/ui/UiRoot.js +0 -1
- package/dist/ui/Widget.js +0 -1
- package/dist/ui/dom/DomOverlay.js +0 -1
- package/dist/ui/dom/DomWorldAnchors.js +0 -1
- package/dist/ui/dom/InputShield.js +0 -1
- package/dist/ui/dom/createStore.js +0 -1
- package/dist/ui/dom/shieldDecision.js +0 -1
- package/dist/ui/dom/worldToScreen.js +0 -1
- package/dist/ui/layout/anchor.js +0 -1
- package/dist/ui/layout/barDrain.js +0 -1
- package/dist/ui/layout/fitToViewport.js +0 -1
- package/dist/ui/layout/focusNav.js +0 -1
- package/dist/ui/layout/geometry.js +0 -1
- package/dist/ui/layout/listWidth.js +0 -1
- package/dist/ui/layout/placeTooltip.js +0 -1
- package/dist/ui/layout/scroll.js +0 -1
- package/dist/ui/layout/slider.js +0 -1
- package/dist/ui/layout/stack.js +0 -1
- package/dist/ui/layout/wrapRow.js +0 -1
- package/dist/ui/rich/RichText.js +87 -0
- package/dist/ui/rich/richFonts.js +105 -0
- package/dist/ui/rich/richLayout.js +132 -0
- package/dist/ui/rich/richMarkup.js +67 -0
- package/dist/ui.js +75 -65
- package/package.json +1 -4
- package/dist/1681-engine.js.map +0 -1
- package/dist/ambient/ColorGrade.js.map +0 -1
- package/dist/ambient/DayClock.js.map +0 -1
- package/dist/ambient/WeatherLayer.js.map +0 -1
- package/dist/ambient/grade.js.map +0 -1
- package/dist/ambient/weather.js.map +0 -1
- package/dist/anim/AnimStateMachine.js.map +0 -1
- package/dist/anim/Animator.js.map +0 -1
- package/dist/anim/animStateCompile.js.map +0 -1
- package/dist/anim/animStateSystem.js.map +0 -1
- package/dist/anim/animationSystem.js.map +0 -1
- package/dist/anim/asepriteSlices.js.map +0 -1
- package/dist/anim/asepriteTags.js.map +0 -1
- package/dist/anim/parseAseprite.js.map +0 -1
- package/dist/assets/AssetLoader.js.map +0 -1
- package/dist/assets/loadAseprite.js.map +0 -1
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js.map +0 -1
- package/dist/audio/Footsteps.js.map +0 -1
- package/dist/audio/MusicPlayer.js.map +0 -1
- package/dist/audio/SoundEngine.js.map +0 -1
- package/dist/audio/cleanTake.js.map +0 -1
- package/dist/audio/music/ElementVoice.js.map +0 -1
- package/dist/audio/music/GraphVoice.js.map +0 -1
- package/dist/audio/music/MusicChannel.js.map +0 -1
- package/dist/audio/music/musicVoice.js.map +0 -1
- package/dist/audio/sampleBank.js.map +0 -1
- package/dist/audio/soundTable.js.map +0 -1
- package/dist/audio/synth.js.map +0 -1
- package/dist/core/BitmapLabel.js.map +0 -1
- package/dist/core/Camera.js.map +0 -1
- package/dist/core/Clock.js.map +0 -1
- package/dist/core/Graphics.js.map +0 -1
- package/dist/core/Group.js.map +0 -1
- package/dist/core/Image.js.map +0 -1
- package/dist/core/ObjectFactory.js.map +0 -1
- package/dist/core/Pointer.js.map +0 -1
- package/dist/core/Rectangle.js.map +0 -1
- package/dist/core/Stage.js.map +0 -1
- package/dist/core/Text.js.map +0 -1
- package/dist/core/TextureRegistry.js.map +0 -1
- package/dist/core/Timeline.js.map +0 -1
- package/dist/core/TimelineBuilder.js.map +0 -1
- package/dist/core/TimelineChild.js.map +0 -1
- package/dist/core/Tweener.js.map +0 -1
- package/dist/core/atlas.js.map +0 -1
- package/dist/core/atlasPlan.js.map +0 -1
- package/dist/core/eases.js.map +0 -1
- package/dist/core/gameObject.js.map +0 -1
- package/dist/core/pixiPatches.js.map +0 -1
- package/dist/core/timelinePlace.js.map +0 -1
- package/dist/core/tweenProps.js.map +0 -1
- package/dist/debug/DebugOverlay.js.map +0 -1
- package/dist/debug/DrawCallCounter.js.map +0 -1
- package/dist/debug/ErrorLog.js.map +0 -1
- package/dist/debug/FrameStats.js.map +0 -1
- package/dist/debug/inspectWorld.js.map +0 -1
- package/dist/diagnostics/ErrorDeduper.js.map +0 -1
- package/dist/diagnostics/FrameSampler.js.map +0 -1
- package/dist/diagnostics/bootWatch.js.map +0 -1
- package/dist/diagnostics/captureErrors.js.map +0 -1
- package/dist/diagnostics/contextLoss.js.map +0 -1
- package/dist/diagnostics/frameStats.js.map +0 -1
- package/dist/diagnostics/gpuInfo.js.map +0 -1
- package/dist/diagnostics/renderGuard.js.map +0 -1
- package/dist/ecs/SparseSet.js.map +0 -1
- package/dist/ecs/World.js.map +0 -1
- package/dist/ecs/fields.js.map +0 -1
- package/dist/engine/Engine.js.map +0 -1
- package/dist/engine/FixedLoop.js.map +0 -1
- package/dist/engine/Scene.js.map +0 -1
- package/dist/engine/SceneManager.js.map +0 -1
- package/dist/events/EventBus.js.map +0 -1
- package/dist/fx/FloatingText.js.map +0 -1
- package/dist/fx/hitStop.js.map +0 -1
- package/dist/fx/viewCull.js.map +0 -1
- package/dist/i18n/Translator.js.map +0 -1
- package/dist/i18n/extractStrings.js.map +0 -1
- package/dist/i18n/formatMessage.js.map +0 -1
- package/dist/input/Actions.js.map +0 -1
- package/dist/input/AimGesture.js.map +0 -1
- package/dist/input/Keyboard.js.map +0 -1
- package/dist/input/Keymap.js.map +0 -1
- package/dist/input/TargetLock.js.map +0 -1
- package/dist/input/aimAxis.js.map +0 -1
- package/dist/input/keyChord.js.map +0 -1
- package/dist/input/longPress.js.map +0 -1
- package/dist/input/stickAxis.js.map +0 -1
- package/dist/input/touchDetect.js.map +0 -1
- package/dist/light/LightLayer.js.map +0 -1
- package/dist/nav/MinHeap.js.map +0 -1
- package/dist/nav/findPath.js.map +0 -1
- package/dist/nav/navGrid.js.map +0 -1
- package/dist/nav/nearestOpen.js.map +0 -1
- package/dist/nav/straightenPath.js.map +0 -1
- package/dist/net/Connection.js.map +0 -1
- package/dist/net/InterpolationBuffer.js.map +0 -1
- package/dist/net/PredictedMover.js.map +0 -1
- package/dist/net/Room.js.map +0 -1
- package/dist/net/RoomHost.js.map +0 -1
- package/dist/net/cadence.js.map +0 -1
- package/dist/net/constants.js.map +0 -1
- package/dist/net/lobby/LobbyClient.js.map +0 -1
- package/dist/net/lobby/LobbyHost.js.map +0 -1
- package/dist/net/lobby/LobbyRooms.js.map +0 -1
- package/dist/net/lobby/Matchmaker.js.map +0 -1
- package/dist/net/movement.js.map +0 -1
- package/dist/net/protocol.js.map +0 -1
- package/dist/net/serverClock.js.map +0 -1
- package/dist/net/snapshotCodec.js.map +0 -1
- package/dist/parallax/Parallax.js.map +0 -1
- package/dist/parallax/ParallaxLayer.js.map +0 -1
- package/dist/parallax/parallaxMath.js.map +0 -1
- package/dist/particles/Emitter.js.map +0 -1
- package/dist/particles/ParticleBudget.js.map +0 -1
- package/dist/particles/ParticleSim.js.map +0 -1
- package/dist/particles/particleCurves.js.map +0 -1
- package/dist/particles/particleSampling.js.map +0 -1
- package/dist/physics/Body.js.map +0 -1
- package/dist/physics/BroadPhase.js.map +0 -1
- package/dist/physics/Contact.js.map +0 -1
- package/dist/physics/ContactSolver.js.map +0 -1
- package/dist/physics/PhysicsWorld.js.map +0 -1
- package/dist/physics/SpatialHash.js.map +0 -1
- package/dist/physics/collide.js.map +0 -1
- package/dist/physics/collidePolygon.js.map +0 -1
- package/dist/physics/contactReport.js.map +0 -1
- package/dist/physics/drawColliders.js.map +0 -1
- package/dist/physics/physicsSystem.js.map +0 -1
- package/dist/physics/polygon.js.map +0 -1
- package/dist/physics/raycast.js.map +0 -1
- package/dist/physics/syncToBody.js.map +0 -1
- package/dist/physics/tileBodies.js.map +0 -1
- package/dist/physics/types.js.map +0 -1
- package/dist/pixel/Darkness.js.map +0 -1
- package/dist/pixel/DitherVignette.js.map +0 -1
- package/dist/pixel/Evaporation.js.map +0 -1
- package/dist/pixel/NightShade.js.map +0 -1
- package/dist/pixel/PixelLayer.js.map +0 -1
- package/dist/pixel/SwayProp.js.map +0 -1
- package/dist/pixel/lights.js.map +0 -1
- package/dist/pixel/nineSlice.js.map +0 -1
- package/dist/pixel/paintLayer.js.map +0 -1
- package/dist/pixel/palette.js.map +0 -1
- package/dist/pixel/pixel.js.map +0 -1
- package/dist/pixel/pixelPaint.js.map +0 -1
- package/dist/pixel/pixelTone.js.map +0 -1
- package/dist/pixel/propKit.js.map +0 -1
- package/dist/pixel/ramp.js.map +0 -1
- package/dist/pixel/selout.js.map +0 -1
- package/dist/pixel/spritePixels.js.map +0 -1
- package/dist/pixel/swayRig.js.map +0 -1
- package/dist/pixel/vignetteMask.js.map +0 -1
- package/dist/pixel/weatherArt.js.map +0 -1
- package/dist/pixel.js.map +0 -1
- package/dist/platform/touch.js.map +0 -1
- package/dist/postfx/BloomFilter.js.map +0 -1
- package/dist/postfx/ChromaticAberrationFilter.js.map +0 -1
- package/dist/postfx/ColorAdjustFilter.js.map +0 -1
- package/dist/postfx/CrtFilter.js.map +0 -1
- package/dist/postfx/PixelateFilter.js.map +0 -1
- package/dist/postfx/PostFx.js.map +0 -1
- package/dist/postfx/ShockwaveFilter.js.map +0 -1
- package/dist/postfx/VignetteFilter.js.map +0 -1
- package/dist/postfx/fxAnimator.js.map +0 -1
- package/dist/postfx/fxShader.js.map +0 -1
- package/dist/postfx.js.map +0 -1
- package/dist/react/ChoiceDialog.js.map +0 -1
- package/dist/react/ConfirmDialog.js.map +0 -1
- package/dist/react/Glyph.js.map +0 -1
- package/dist/react/Modal.js.map +0 -1
- package/dist/react/Panel.js.map +0 -1
- package/dist/react/PixelImage.js.map +0 -1
- package/dist/react/Select.js.map +0 -1
- package/dist/react/Slider.js.map +0 -1
- package/dist/react/SplitPane.js.map +0 -1
- package/dist/react/TabStrip.js.map +0 -1
- package/dist/react/TitleTips.js.map +0 -1
- package/dist/react/Tooltip.js.map +0 -1
- package/dist/react/UiProvider.js.map +0 -1
- package/dist/react/baseCss.js.map +0 -1
- package/dist/react/choiceStore.js.map +0 -1
- package/dist/react/classNames.js.map +0 -1
- package/dist/react/confirmStore.js.map +0 -1
- package/dist/react/labels.js.map +0 -1
- package/dist/react/placement.js.map +0 -1
- package/dist/react/useFillSheet.js.map +0 -1
- package/dist/react/useFitToViewport.js.map +0 -1
- package/dist/react/usePicked.js.map +0 -1
- package/dist/react/useStore.js.map +0 -1
- package/dist/react/useViewport.js.map +0 -1
- package/dist/react.js.map +0 -1
- package/dist/rig/PosePlayer.js.map +0 -1
- package/dist/rig/RigView.js.map +0 -1
- package/dist/rig/Skeleton.js.map +0 -1
- package/dist/rig/humanoid.js.map +0 -1
- package/dist/rig/humanoid.json.js.map +0 -1
- package/dist/rig/humanoidPoses.js.map +0 -1
- package/dist/rig/poseMath.js.map +0 -1
- package/dist/rig/poses.json.js.map +0 -1
- package/dist/save/Autosaver.js.map +0 -1
- package/dist/save/MemoryBackend.js.map +0 -1
- package/dist/save/SaveStore.js.map +0 -1
- package/dist/save/WebStorageBackend.js.map +0 -1
- package/dist/save/checksum.js.map +0 -1
- package/dist/save/migrateSave.js.map +0 -1
- package/dist/settings.js.map +0 -1
- package/dist/tilemap/TilemapView.js.map +0 -1
- package/dist/tilemap/collision.js.map +0 -1
- package/dist/tilemap/tiled.js.map +0 -1
- package/dist/transitions/CrossfadeTransition.js.map +0 -1
- package/dist/transitions/DitherWipeTransition.js.map +0 -1
- package/dist/transitions/FadeTransition.js.map +0 -1
- package/dist/transitions/Letterbox.js.map +0 -1
- package/dist/transitions/ditherMask.js.map +0 -1
- package/dist/transitions/transitionTo.js.map +0 -1
- package/dist/transitions/tweenDone.js.map +0 -1
- package/dist/ui/Bar.js.map +0 -1
- package/dist/ui/Button.js.map +0 -1
- package/dist/ui/Dialog.js.map +0 -1
- package/dist/ui/FocusManager.js.map +0 -1
- package/dist/ui/Label.js.map +0 -1
- package/dist/ui/List.js.map +0 -1
- package/dist/ui/Panel.js.map +0 -1
- package/dist/ui/ScrollView.js.map +0 -1
- package/dist/ui/Slider.js.map +0 -1
- package/dist/ui/Stack.js.map +0 -1
- package/dist/ui/Toggle.js.map +0 -1
- package/dist/ui/UiHost.js.map +0 -1
- package/dist/ui/UiPointerGate.js.map +0 -1
- package/dist/ui/UiRoot.js.map +0 -1
- package/dist/ui/Widget.js.map +0 -1
- package/dist/ui/dom/DomOverlay.js.map +0 -1
- package/dist/ui/dom/DomWorldAnchors.js.map +0 -1
- package/dist/ui/dom/InputShield.js.map +0 -1
- package/dist/ui/dom/createStore.js.map +0 -1
- package/dist/ui/dom/shieldDecision.js.map +0 -1
- package/dist/ui/dom/worldToScreen.js.map +0 -1
- package/dist/ui/layout/anchor.js.map +0 -1
- package/dist/ui/layout/barDrain.js.map +0 -1
- package/dist/ui/layout/fitToViewport.js.map +0 -1
- package/dist/ui/layout/focusNav.js.map +0 -1
- package/dist/ui/layout/geometry.js.map +0 -1
- package/dist/ui/layout/listWidth.js.map +0 -1
- package/dist/ui/layout/placeTooltip.js.map +0 -1
- package/dist/ui/layout/scroll.js.map +0 -1
- package/dist/ui/layout/slider.js.map +0 -1
- package/dist/ui/layout/stack.js.map +0 -1
- package/dist/ui/layout/wrapRow.js.map +0 -1
- package/dist/ui.js.map +0 -1
package/dist/ambient/DayClock.js
CHANGED
package/dist/ambient/grade.js
CHANGED
package/dist/ambient/weather.js
CHANGED
package/dist/anim/Animator.js
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { sound as u } from "../audio/SoundEngine.js";
|
|
2
|
+
import { parseTiled as f } from "../tilemap/tiled.js";
|
|
3
|
+
import { collectAtlasPages as l, duplicateFrames as w, parseAtlas as p } from "./textureAtlas.js";
|
|
4
|
+
function c(r, t) {
|
|
3
5
|
if (/^[a-z][a-z0-9+.-]*:/i.test(r) || r.startsWith("/")) return r;
|
|
4
6
|
const a = (t.slice(0, t.lastIndexOf("/") + 1) + r).split("/"), s = [];
|
|
5
|
-
for (const
|
|
6
|
-
|
|
7
|
+
for (const i of a)
|
|
8
|
+
i === ".." && s.length && s[s.length - 1] !== ".." && s[s.length - 1] !== "" ? s.pop() : i !== "." && s.push(i);
|
|
7
9
|
return s.join("/");
|
|
8
10
|
}
|
|
9
|
-
async function
|
|
11
|
+
async function m(r) {
|
|
10
12
|
const t = await createImageBitmap(r), e = document.createElement("canvas");
|
|
11
13
|
e.width = t.width, e.height = t.height;
|
|
12
14
|
const a = e.getContext("2d");
|
|
13
15
|
if (!a) throw new Error("AssetLoader: no 2D context (out of canvas memory?)");
|
|
14
16
|
return a.drawImage(t, 0, 0), t.close(), e;
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
async function g(r, t, e) {
|
|
19
|
+
if (typeof FontFace > "u" || typeof document > "u" || !document.fonts)
|
|
20
|
+
throw new Error(`AssetLoader: this browser cannot load the font "${r}" (no FontFace)`);
|
|
21
|
+
const a = new FontFace(r, t, e);
|
|
22
|
+
await a.load(), document.fonts.add(a);
|
|
23
|
+
}
|
|
24
|
+
class $ {
|
|
17
25
|
constructor(t, e = {}) {
|
|
18
|
-
this.textures = t, this.options = e, this.fetcher = e.fetch ?? ((a) => fetch(a)), this.toCanvas = e.toCanvas ??
|
|
26
|
+
this.textures = t, this.options = e, this.fetcher = e.fetch ?? ((a) => fetch(a)), this.toCanvas = e.toCanvas ?? m;
|
|
19
27
|
}
|
|
20
28
|
textures;
|
|
21
29
|
options;
|
|
22
30
|
queue = [];
|
|
23
31
|
data = /* @__PURE__ */ new Map();
|
|
24
32
|
maps = /* @__PURE__ */ new Map();
|
|
33
|
+
atlases = /* @__PURE__ */ new Map();
|
|
34
|
+
/** Decoded audio by key; a key with bytes only waits for a context (`decodeAudio`). */
|
|
35
|
+
audioBuffers = /* @__PURE__ */ new Map();
|
|
36
|
+
audioBytes = /* @__PURE__ */ new Map();
|
|
37
|
+
decoding = /* @__PURE__ */ new Map();
|
|
25
38
|
fetcher;
|
|
26
39
|
toCanvas;
|
|
27
40
|
total = 0;
|
|
@@ -50,12 +63,87 @@ class u {
|
|
|
50
63
|
/** A Tiled JSON map, then every tileset image it names (resolved beside the map file). */
|
|
51
64
|
tilemap(t, e, a = {}) {
|
|
52
65
|
return this.add(t, async () => {
|
|
53
|
-
const s =
|
|
66
|
+
const s = f(await (await this.request(e)).json());
|
|
54
67
|
this.maps.set(t, s);
|
|
55
|
-
const
|
|
56
|
-
for (const
|
|
68
|
+
const i = a.textureKey ?? ((n) => n.name);
|
|
69
|
+
for (const n of s.tilesets) this.image(i(n), c(n.image, e));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A TexturePacker (or Pixi) JSON atlas, hash or array format: its page image, and for a multipack atlas every page
|
|
74
|
+
* named in `meta.related_multi_packs` (each resolved beside the file naming it). The first page is the texture
|
|
75
|
+
* `key`, further pages `key~1`, `key~2`…, and every frame of every page is found as `textures.get(key, frameName)`.
|
|
76
|
+
* Counts as one asset in the progress.
|
|
77
|
+
*/
|
|
78
|
+
atlas(t, e) {
|
|
79
|
+
return this.add(t, async () => {
|
|
80
|
+
const a = this.textures.addAtlas?.bind(this.textures);
|
|
81
|
+
if (!a) throw new Error(`AssetLoader: the texture sink cannot take atlases (no addAtlas) for "${t}"`);
|
|
82
|
+
const s = await l(
|
|
83
|
+
e,
|
|
84
|
+
async (o) => p(await (await this.request(o)).json(), o),
|
|
85
|
+
c
|
|
86
|
+
), i = await Promise.all(s.map((o) => this.blob(c(o.page.image, o.url)).then((h) => this.toCanvas(h)))), n = w(s.map((o) => o.page));
|
|
87
|
+
n.length && console.warn(`[assets] atlas "${t}" names ${n.length} frame(s) on more than one page: ${n.slice(0, 5).join(", ")}`), a(t, s.map((o, h) => ({ canvas: i[h], frames: o.page.frames })));
|
|
88
|
+
const d = {};
|
|
89
|
+
for (const o of s) Object.assign(d, o.page.animations);
|
|
90
|
+
this.atlases.set(t, { frames: [...new Set(s.flatMap((o) => o.page.frames.map((h) => h.name)))], animations: d, pages: s.length });
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A web font (woff2, woff, ttf) under `family`, added to `document.fonts` once loaded so canvas text and the DOM can
|
|
95
|
+
* use it at once — load fonts before the first `Text` is drawn, or it measures with the fallback.
|
|
96
|
+
*/
|
|
97
|
+
font(t, e, a) {
|
|
98
|
+
const s = this.options.addFont ?? g;
|
|
99
|
+
return this.add(t, async () => {
|
|
100
|
+
await s(t, await this.bytes(e), a);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A sound file decoded into an `AudioBuffer` through the engine's audio context (`getAudio`). Before any context
|
|
105
|
+
* exists (browsers open one only after a gesture) the bytes are kept and decoded by `decodeAudio`, so a loading
|
|
106
|
+
* screen never has to wait for the player to click.
|
|
107
|
+
*/
|
|
108
|
+
audio(t, e) {
|
|
109
|
+
return this.add(t, async () => {
|
|
110
|
+
const a = await this.bytes(e);
|
|
111
|
+
this.audioBuffers.delete(t), this.decoding.delete(t);
|
|
112
|
+
const s = (this.options.audioContext ?? (() => u.audioContext))();
|
|
113
|
+
s ? this.audioBuffers.set(t, await this.decode(s, a, e)) : this.audioBytes.set(t, a);
|
|
57
114
|
});
|
|
58
115
|
}
|
|
116
|
+
/** A loaded sound, decoded; null while it waits for an audio context (`decodeAudio`). */
|
|
117
|
+
getAudio(t) {
|
|
118
|
+
const e = this.audioBuffers.get(t);
|
|
119
|
+
if (e) return e;
|
|
120
|
+
if (this.audioBytes.has(t)) return null;
|
|
121
|
+
throw new Error(`AssetLoader: no audio loaded as "${t}"`);
|
|
122
|
+
}
|
|
123
|
+
/** A loaded sound, decoding its kept bytes through `ctx` (default: the loader's context) the first time. */
|
|
124
|
+
decodeAudio(t, e) {
|
|
125
|
+
const a = this.audioBuffers.get(t);
|
|
126
|
+
if (a) return Promise.resolve(a);
|
|
127
|
+
const s = this.decoding.get(t);
|
|
128
|
+
if (s) return s;
|
|
129
|
+
const i = this.audioBytes.get(t);
|
|
130
|
+
if (!i) return Promise.reject(new Error(`AssetLoader: no audio loaded as "${t}"`));
|
|
131
|
+
const n = e ?? (this.options.audioContext ?? (() => u.audioContext))();
|
|
132
|
+
if (!n) return Promise.reject(new Error(`AssetLoader: no audio context to decode "${t}" yet`));
|
|
133
|
+
const d = this.decode(n, i, t).then(
|
|
134
|
+
(o) => (this.audioBuffers.set(t, o), this.audioBytes.delete(t), this.decoding.delete(t), o),
|
|
135
|
+
(o) => {
|
|
136
|
+
throw this.decoding.delete(t), o;
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
return this.decoding.set(t, d), d;
|
|
140
|
+
}
|
|
141
|
+
/** What a loaded atlas holds: its frame names and animations. */
|
|
142
|
+
getAtlas(t) {
|
|
143
|
+
const e = this.atlases.get(t);
|
|
144
|
+
if (!e) throw new Error(`AssetLoader: no atlas loaded as "${t}"`);
|
|
145
|
+
return e;
|
|
146
|
+
}
|
|
59
147
|
/** Runs everything queued; `onProgress` after each asset. Safe to call again after queueing more. */
|
|
60
148
|
async load(t) {
|
|
61
149
|
const e = Math.max(1, this.options.concurrency ?? 6), a = async () => {
|
|
@@ -83,7 +171,7 @@ class u {
|
|
|
83
171
|
return this.queue.push({ key: t, run: e }), this.total++, this;
|
|
84
172
|
}
|
|
85
173
|
async request(t) {
|
|
86
|
-
const e =
|
|
174
|
+
const e = c(t, this.options.baseUrl ?? "");
|
|
87
175
|
let a;
|
|
88
176
|
try {
|
|
89
177
|
a = await this.fetcher(e);
|
|
@@ -96,9 +184,19 @@ class u {
|
|
|
96
184
|
async blob(t) {
|
|
97
185
|
return (await this.request(t)).blob();
|
|
98
186
|
}
|
|
187
|
+
async bytes(t) {
|
|
188
|
+
const e = await this.request(t);
|
|
189
|
+
return typeof e.arrayBuffer == "function" ? e.arrayBuffer() : (await e.blob()).arrayBuffer();
|
|
190
|
+
}
|
|
191
|
+
async decode(t, e, a) {
|
|
192
|
+
try {
|
|
193
|
+
return await t.decodeAudioData(e.slice(0));
|
|
194
|
+
} catch (s) {
|
|
195
|
+
throw new Error(`AssetLoader: could not decode audio ${a}: ${s instanceof Error ? s.message : String(s)}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
99
198
|
}
|
|
100
199
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
200
|
+
$ as AssetLoader,
|
|
201
|
+
c as resolveUrl
|
|
103
202
|
};
|
|
104
|
-
//# sourceMappingURL=AssetLoader.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function m(n) {
|
|
2
|
+
const e = n;
|
|
3
|
+
return typeof e == "object" && e !== null && [e.x, e.y, e.w, e.h].every((t) => typeof t == "number" && Number.isFinite(t));
|
|
4
|
+
}
|
|
5
|
+
function u(n, e, t) {
|
|
6
|
+
if (!m(e.frame)) throw new Error(`${t}: frame "${n}" has no frame rect`);
|
|
7
|
+
const o = e.frame, i = e.rotated === !0, a = {
|
|
8
|
+
name: n,
|
|
9
|
+
x: Math.floor(o.x),
|
|
10
|
+
y: Math.floor(o.y),
|
|
11
|
+
w: Math.floor(i ? o.h : o.w),
|
|
12
|
+
h: Math.floor(i ? o.w : o.h),
|
|
13
|
+
rotated: i,
|
|
14
|
+
sourceW: Math.floor(e.trimmed && e.sourceSize ? e.sourceSize.w : o.w),
|
|
15
|
+
sourceH: Math.floor(e.trimmed && e.sourceSize ? e.sourceSize.h : o.h)
|
|
16
|
+
};
|
|
17
|
+
if (e.trimmed !== !1 && m(e.spriteSourceSize) && e.sourceSize) {
|
|
18
|
+
const f = e.spriteSourceSize;
|
|
19
|
+
f.x === 0 && f.y === 0 && o.w === e.sourceSize.w && o.h === e.sourceSize.h || (a.trim = { x: Math.floor(f.x), y: Math.floor(f.y), w: Math.floor(o.w), h: Math.floor(o.h) }, a.sourceW = Math.floor(e.sourceSize.w), a.sourceH = Math.floor(e.sourceSize.h));
|
|
20
|
+
}
|
|
21
|
+
const r = e.anchor ?? e.pivot;
|
|
22
|
+
return r && typeof r.x == "number" && typeof r.y == "number" && (a.anchor = { x: r.x, y: r.y }), a;
|
|
23
|
+
}
|
|
24
|
+
function h(n, e = "atlas") {
|
|
25
|
+
const t = n;
|
|
26
|
+
if (typeof t != "object" || t === null || typeof t.frames != "object" || t.frames === null)
|
|
27
|
+
throw new Error(`${e}: not a TexturePacker JSON atlas (no "frames")`);
|
|
28
|
+
const o = t.meta?.image;
|
|
29
|
+
if (typeof o != "string" || o === "") throw new Error(`${e}: no "meta.image"`);
|
|
30
|
+
const i = Array.isArray(t.frames) ? t.frames.map((s, c) => u(typeof s?.filename == "string" ? s.filename : String(c), s ?? {}, e)) : Object.entries(t.frames).map(([s, c]) => u(s, c ?? {}, e)), a = Array.isArray(t.meta?.related_multi_packs) ? t.meta.related_multi_packs.filter((s) => typeof s == "string" && s !== "") : [], r = {};
|
|
31
|
+
if (typeof t.animations == "object" && t.animations !== null)
|
|
32
|
+
for (const [s, c] of Object.entries(t.animations))
|
|
33
|
+
Array.isArray(c) && (r[s] = c.filter((l) => typeof l == "string"));
|
|
34
|
+
const f = Number(t.meta?.scale);
|
|
35
|
+
return { image: o, frames: i, animations: r, related: a, scale: Number.isFinite(f) && f > 0 ? f : 1 };
|
|
36
|
+
}
|
|
37
|
+
async function y(n, e, t) {
|
|
38
|
+
const o = /* @__PURE__ */ new Set([n]), i = [], a = [n];
|
|
39
|
+
for (let r = a.shift(); r !== void 0; r = a.shift()) {
|
|
40
|
+
const f = await e(r);
|
|
41
|
+
i.push({ url: r, page: f });
|
|
42
|
+
for (const s of f.related) {
|
|
43
|
+
const c = t(s, r);
|
|
44
|
+
o.has(c) || (o.add(c), a.push(c));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return i;
|
|
48
|
+
}
|
|
49
|
+
function p(n) {
|
|
50
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
51
|
+
for (const o of n) for (const i of o.frames) (e.has(i.name) ? t : e).add(i.name);
|
|
52
|
+
return [...t];
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
y as collectAtlasPages,
|
|
56
|
+
p as duplicateFrames,
|
|
57
|
+
h as parseAtlas
|
|
58
|
+
};
|
package/dist/audio/Footsteps.js
CHANGED
|
@@ -2,8 +2,8 @@ import { engineSettings as m } from "../settings.js";
|
|
|
2
2
|
import { SampleBank as E, hasTakes as y } from "./sampleBank.js";
|
|
3
3
|
import { SOUNDS as u } from "./soundTable.js";
|
|
4
4
|
import { renderRecipe as R, SYNTH_RATE as k } from "./synth.js";
|
|
5
|
-
const p = 480, _ = 10, q = 6, B = 60, F = 0.45,
|
|
6
|
-
class
|
|
5
|
+
const p = 480, _ = 10, q = 6, B = 60, F = 0.45, C = 0.05, w = 80, g = [18e3, 1800], T = { freq: 3500, gainDb: -7 }, O = 11e3;
|
|
6
|
+
class V {
|
|
7
7
|
ctx = null;
|
|
8
8
|
master = null;
|
|
9
9
|
buffers = /* @__PURE__ */ new Map();
|
|
@@ -32,6 +32,13 @@ class C {
|
|
|
32
32
|
this.ctx && this.master && this.master.gain.setTargetAtTime(this.level(s.sfxVolume), this.ctx.currentTime, 0.02);
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The effects' audio context once something opened it (the first gesture does), else null: never created here, so
|
|
37
|
+
* asking does not open a context the browser would hold suspended. `AssetLoader.audio` decodes through it.
|
|
38
|
+
*/
|
|
39
|
+
get audioContext() {
|
|
40
|
+
return this.ctx;
|
|
41
|
+
}
|
|
35
42
|
play(t, n = {}) {
|
|
36
43
|
if (!t || !u.recipes[t] && !y(t) || m.getState().sfxVolume <= 0) return;
|
|
37
44
|
const e = this.ctx;
|
|
@@ -53,7 +60,7 @@ class C {
|
|
|
53
60
|
v && (i *= u.recipes[t]?.fileGain ?? 1), this.lastAt.set(t, x);
|
|
54
61
|
const c = e.createBufferSource();
|
|
55
62
|
c.buffer = l;
|
|
56
|
-
const S = u.recipes[t]?.jitter ??
|
|
63
|
+
const S = u.recipes[t]?.jitter ?? C;
|
|
57
64
|
c.playbackRate.value = 1 + (Math.random() * 2 - 1) * S;
|
|
58
65
|
const a = e.createGain();
|
|
59
66
|
a.gain.value = Math.min(1, i);
|
|
@@ -79,7 +86,7 @@ class C {
|
|
|
79
86
|
const t = this.ctx.createBiquadFilter();
|
|
80
87
|
t.type = "highshelf", t.frequency.value = T.freq, t.gain.value = T.gainDb;
|
|
81
88
|
const n = this.ctx.createBiquadFilter();
|
|
82
|
-
n.type = "lowpass", n.frequency.value =
|
|
89
|
+
n.type = "lowpass", n.frequency.value = O, this.master.connect(t).connect(n).connect(this.ctx.destination);
|
|
83
90
|
const e = this.ctx, i = () => {
|
|
84
91
|
const s = e.state === "running";
|
|
85
92
|
this.onRunning(s), s && this.prerender(e);
|
|
@@ -111,9 +118,8 @@ class C {
|
|
|
111
118
|
return this.buffers.set(n, s), s;
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
|
-
const H = new
|
|
121
|
+
const H = new V();
|
|
115
122
|
export {
|
|
116
|
-
|
|
123
|
+
V as SoundEngine,
|
|
117
124
|
H as sound
|
|
118
125
|
};
|
|
119
|
-
//# sourceMappingURL=SoundEngine.js.map
|
package/dist/audio/cleanTake.js
CHANGED
package/dist/audio/sampleBank.js
CHANGED
package/dist/audio/soundTable.js
CHANGED
package/dist/audio/synth.js
CHANGED
package/dist/core/BitmapLabel.js
CHANGED
package/dist/core/Camera.js
CHANGED
|
@@ -8,7 +8,7 @@ class g {
|
|
|
8
8
|
zoom = 1;
|
|
9
9
|
/** The zoom `reset` goes back to: the engine sets it from its `zoom` option (default 1). */
|
|
10
10
|
defaultZoom = 1;
|
|
11
|
-
/** Backing pixels per screen pixel (the renderer's resolution, `zoomResolution`): what `snap` rounds to. */
|
|
11
|
+
/** Backing pixels per screen pixel (the renderer's resolution, `zoomResolution(zoom, devicePixelRatio)`): what `snap` rounds to. */
|
|
12
12
|
resolution = 1;
|
|
13
13
|
/** Lands the view on whole backing pixels (pixel art); off, the world moves smoothly between them. */
|
|
14
14
|
roundPixels = !1;
|
|
@@ -147,4 +147,3 @@ class g {
|
|
|
147
147
|
export {
|
|
148
148
|
g as Camera
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=Camera.js.map
|
package/dist/core/Clock.js
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import { runDue as o } from "./runDue.js";
|
|
2
|
+
class i {
|
|
3
|
+
constructor(e, r) {
|
|
4
|
+
this.at = e, this.fn = r;
|
|
5
|
+
}
|
|
6
|
+
at;
|
|
7
|
+
fn;
|
|
8
|
+
removed = !1;
|
|
9
|
+
/** An arrow, so a handle's `remove` still works when taken off it (`const { remove } = …`). */
|
|
10
|
+
remove = () => {
|
|
11
|
+
this.removed = !0;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
class h {
|
|
2
15
|
now = performance.now();
|
|
16
|
+
/** Told of every error a timer throws (default: logged). `Stage` routes it into its guarded-step reporting. */
|
|
17
|
+
onError = (e) => console.error("[timer] failed", e);
|
|
3
18
|
timers = [];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
19
|
+
due = [];
|
|
20
|
+
/** Made once, so `update` hands `runDue` no fresh closure; reads `onError` late so it may be swapped any time. */
|
|
21
|
+
report = (e) => this.onError(e);
|
|
22
|
+
delayedCall(e, r) {
|
|
23
|
+
const t = new i(this.now + e, r);
|
|
24
|
+
return this.timers.push(t), t;
|
|
25
|
+
}
|
|
26
|
+
/** Timers waiting to run (removed ones not yet swept included). */
|
|
27
|
+
get pending() {
|
|
28
|
+
return this.timers.length;
|
|
9
29
|
}
|
|
10
|
-
update(
|
|
11
|
-
this.now =
|
|
12
|
-
const t = this.timers.filter((e) => !e.removed && e.at <= r);
|
|
13
|
-
if (t.length) {
|
|
14
|
-
this.timers = this.timers.filter((e) => !e.removed && e.at > r);
|
|
15
|
-
for (const e of t)
|
|
16
|
-
try {
|
|
17
|
-
e.fn();
|
|
18
|
-
} catch (s) {
|
|
19
|
-
console.error("[timer] failed", s);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
30
|
+
update(e) {
|
|
31
|
+
this.now = e, o(this.timers, this.due, e, this.report);
|
|
22
32
|
}
|
|
23
33
|
clear() {
|
|
24
|
-
this.
|
|
34
|
+
for (const e of this.due) e.removed = !0;
|
|
35
|
+
this.timers.length = 0;
|
|
25
36
|
}
|
|
26
37
|
}
|
|
27
38
|
export {
|
|
28
|
-
|
|
39
|
+
h as Clock
|
|
29
40
|
};
|
|
30
|
-
//# sourceMappingURL=Clock.js.map
|
package/dist/core/Graphics.js
CHANGED
package/dist/core/Group.js
CHANGED
package/dist/core/Image.js
CHANGED
package/dist/core/Pointer.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { isTouchUi as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { isTouchUi as v } from "../platform/touch.js";
|
|
2
|
+
import { isPointerLocked as m, requestPointerLock as d, exitPointerLock as a } from "../platform/pointerLock.js";
|
|
3
|
+
function s(e) {
|
|
4
|
+
return e === 1 ? 4 : e === 2 ? 2 : e === 0 ? 1 : 0;
|
|
4
5
|
}
|
|
5
|
-
class
|
|
6
|
-
constructor(
|
|
7
|
-
this.canvas =
|
|
8
|
-
const i =
|
|
9
|
-
const h = (
|
|
10
|
-
i &&
|
|
6
|
+
class c {
|
|
7
|
+
constructor(o) {
|
|
8
|
+
this.canvas = o;
|
|
9
|
+
const i = v(), n = (t, u, l) => {
|
|
10
|
+
const h = (r) => {
|
|
11
|
+
i && r instanceof PointerEvent && r.pointerType === "touch" || l(r);
|
|
11
12
|
};
|
|
12
|
-
t.addEventListener(
|
|
13
|
+
t.addEventListener(u, h), this.cleanup.push(() => t.removeEventListener(u, h));
|
|
13
14
|
};
|
|
14
|
-
o
|
|
15
|
-
this.track(t), !
|
|
16
|
-
}),
|
|
17
|
-
this.track(t), t.button >= 0 && (this.buttons = (t.buttons & s(t.button)) !== 0 ? this.buttons | s(t.button) : this.buttons & ~s(t.button));
|
|
18
|
-
}),
|
|
15
|
+
n(o, "pointerdown", (t) => {
|
|
16
|
+
this.track(t), !c.ignorePress?.(t) && (this.buttons |= s(t.button));
|
|
17
|
+
}), n(window, "pointermove", (t) => {
|
|
18
|
+
this.locked ? (this.moveX += t.movementX, this.moveY += t.movementY) : this.track(t), t.button >= 0 && (this.buttons = (t.buttons & s(t.button)) !== 0 ? this.buttons | s(t.button) : this.buttons & ~s(t.button));
|
|
19
|
+
}), n(window, "pointerup", (t) => {
|
|
19
20
|
this.buttons &= ~s(t.button);
|
|
20
|
-
}),
|
|
21
|
+
}), n(window, "blur", () => {
|
|
21
22
|
this.buttons = 0;
|
|
22
|
-
}), o
|
|
23
|
+
}), n(o, "contextmenu", (t) => t.preventDefault());
|
|
23
24
|
}
|
|
24
25
|
canvas;
|
|
25
26
|
/**
|
|
@@ -33,6 +34,9 @@ class l {
|
|
|
33
34
|
worldX = 0;
|
|
34
35
|
worldY = 0;
|
|
35
36
|
buttons = 0;
|
|
37
|
+
/** Raw mouse travel (`movementX/Y`) summed since the last `takeMovement`, kept only while the pointer is locked. */
|
|
38
|
+
moveX = 0;
|
|
39
|
+
moveY = 0;
|
|
36
40
|
cleanup = [];
|
|
37
41
|
leftButtonDown() {
|
|
38
42
|
return (this.buttons & 1) !== 0;
|
|
@@ -40,19 +44,37 @@ class l {
|
|
|
40
44
|
rightButtonDown() {
|
|
41
45
|
return (this.buttons & 2) !== 0;
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
/** True while the canvas holds the pointer (`lock`). */
|
|
48
|
+
get locked() {
|
|
49
|
+
return m(this.canvas);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Locks the pointer to the canvas for mouse-look: the cursor hides and `takeMovement` returns how far the mouse went.
|
|
53
|
+
* Call from a press or key handler (browsers allow it only in a gesture); resolves whether the lock holds.
|
|
54
|
+
*/
|
|
55
|
+
lock(o = {}) {
|
|
56
|
+
return this.moveX = this.moveY = 0, d(this.canvas, o);
|
|
57
|
+
}
|
|
58
|
+
unlock() {
|
|
59
|
+
this.locked && a();
|
|
60
|
+
}
|
|
61
|
+
/** The mouse travel (CSS pixels) since the last call while locked, then zeroed; read it once per step. */
|
|
62
|
+
takeMovement() {
|
|
63
|
+
const o = { x: this.moveX, y: this.moveY };
|
|
64
|
+
return this.moveX = this.moveY = 0, o;
|
|
65
|
+
}
|
|
66
|
+
updateWorldPoint(o) {
|
|
67
|
+
this.worldX = o.scrollX + this.x / o.zoom, this.worldY = o.scrollY + this.y / o.zoom;
|
|
45
68
|
}
|
|
46
69
|
destroy() {
|
|
47
|
-
for (const
|
|
70
|
+
for (const o of this.cleanup) o();
|
|
48
71
|
this.cleanup.length = 0;
|
|
49
72
|
}
|
|
50
|
-
track(
|
|
73
|
+
track(o) {
|
|
51
74
|
const i = this.canvas.getBoundingClientRect();
|
|
52
|
-
this.x =
|
|
75
|
+
this.x = o.clientX - i.left, this.y = o.clientY - i.top;
|
|
53
76
|
}
|
|
54
77
|
}
|
|
55
78
|
export {
|
|
56
|
-
|
|
79
|
+
c as Pointer
|
|
57
80
|
};
|
|
58
|
-
//# sourceMappingURL=Pointer.js.map
|
package/dist/core/Rectangle.js
CHANGED