@the-inclusionist/engine 9.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -78
- package/app/css/style.css +761 -377
- package/app/public/vendor/fonts/playwrite-cu.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es-deco.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-es.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-j.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-gb-s.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pe.woff2 +0 -0
- package/app/public/vendor/fonts/playwrite-pt.woff2 +0 -0
- package/app/public/vendor/fonts-licences/NOTICE.txt +166 -0
- package/app/public/vendor/fonts-licences/OFL-1.1.txt +86 -0
- package/app/public/vendor/fonts.css +36 -84
- package/dist-pkg/boot/create-game.d.ts +499 -219
- package/dist-pkg/boot/create-game.js +3944 -562
- package/dist-pkg/core/a11y-sr.d.ts +25 -3
- package/dist-pkg/core/a11y-sr.js +38 -19
- package/dist-pkg/core/accessible-label.d.ts +17 -0
- package/dist-pkg/core/accessible-label.js +37 -0
- package/dist-pkg/core/accommodation-subjects.d.ts +26 -0
- package/dist-pkg/core/accommodation-subjects.js +32 -0
- package/dist-pkg/core/accommodations.d.ts +125 -0
- package/dist-pkg/core/accommodations.js +195 -0
- package/dist-pkg/core/actions.d.ts +108 -55
- package/dist-pkg/core/actions.js +122 -71
- package/dist-pkg/core/calm-mode.d.ts +31 -0
- package/dist-pkg/core/calm-mode.js +47 -0
- package/dist-pkg/core/camera-cycle.d.ts +15 -0
- package/dist-pkg/core/camera-cycle.js +7 -0
- package/dist-pkg/core/caption-duration.d.ts +15 -0
- package/dist-pkg/core/caption-duration.js +19 -0
- package/dist-pkg/core/cartridge-problems.d.ts +34 -0
- package/dist-pkg/core/cartridge-problems.js +53 -0
- package/dist-pkg/core/constants.d.ts +0 -54
- package/dist-pkg/core/constants.js +9 -76
- package/dist-pkg/core/contract.d.ts +142 -164
- package/dist-pkg/core/contract.js +222 -208
- package/dist-pkg/core/dom-query.d.ts +4 -4
- package/dist-pkg/core/dom-query.js +12 -20
- package/dist-pkg/core/entity.d.ts +62 -77
- package/dist-pkg/core/entity.js +18 -32
- package/dist-pkg/core/escape-html.d.ts +9 -10
- package/dist-pkg/core/escape-html.js +16 -20
- package/dist-pkg/core/flash-threshold.d.ts +17 -0
- package/dist-pkg/core/flash-threshold.js +113 -0
- package/dist-pkg/core/game-speed.d.ts +11 -0
- package/dist-pkg/core/game-speed.js +16 -0
- package/dist-pkg/core/genres.d.ts +20 -0
- package/dist-pkg/core/genres.js +44 -0
- package/dist-pkg/core/i18n.d.ts +71 -60
- package/dist-pkg/core/i18n.js +186 -200
- package/dist-pkg/core/loop.d.ts +17 -6
- package/dist-pkg/core/loop.js +26 -26
- package/dist-pkg/core/pause-icon-catalogue.d.ts +15 -0
- package/dist-pkg/core/pause-icon-catalogue.js +54 -0
- package/dist-pkg/core/ring.d.ts +17 -0
- package/dist-pkg/core/ring.js +29 -0
- package/dist-pkg/core/rng.d.ts +7 -12
- package/dist-pkg/core/rng.js +23 -53
- package/dist-pkg/core/route.d.ts +26 -26
- package/dist-pkg/core/route.js +126 -121
- package/dist-pkg/core/scenes.d.ts +37 -40
- package/dist-pkg/core/scenes.js +41 -43
- package/dist-pkg/core/screens.d.ts +4 -4
- package/dist-pkg/core/screens.js +11 -16
- package/dist-pkg/core/session-clock.d.ts +23 -0
- package/dist-pkg/core/session-clock.js +37 -0
- package/dist-pkg/core/setting-defaults.d.ts +61 -0
- package/dist-pkg/core/setting-defaults.js +66 -0
- package/dist-pkg/core/speech-rate.d.ts +29 -0
- package/dist-pkg/core/speech-rate.js +47 -0
- package/dist-pkg/core/state.d.ts +118 -118
- package/dist-pkg/core/state.js +322 -297
- package/dist-pkg/core/visual-cycles.d.ts +30 -0
- package/dist-pkg/core/visual-cycles.js +52 -0
- package/dist-pkg/core/visual-state.d.ts +13 -0
- package/dist-pkg/core/visual-state.js +6 -0
- package/dist-pkg/educational/activities-registry.d.ts +1 -1
- package/dist-pkg/educational/activities-registry.js +9 -8
- package/dist-pkg/educational/adaptive-engine.d.ts +11 -11
- package/dist-pkg/educational/adaptive-engine.js +17 -17
- package/dist-pkg/educational/segment-bar.d.ts +12 -12
- package/dist-pkg/educational/segment-bar.js +9 -9
- package/dist-pkg/i18n/en.js +324 -223
- package/dist-pkg/i18n/es.js +323 -223
- package/dist-pkg/i18n/pt.js +348 -226
- package/dist-pkg/input/default-bindings.d.ts +37 -38
- package/dist-pkg/input/default-bindings.js +127 -144
- package/dist-pkg/input/devices.d.ts +7 -7
- package/dist-pkg/input/devices.js +17 -16
- package/dist-pkg/input/edges.d.ts +23 -32
- package/dist-pkg/input/edges.js +23 -28
- package/dist-pkg/input/empathy-filter.d.ts +22 -0
- package/dist-pkg/input/empathy-filter.js +34 -0
- package/dist-pkg/input/face-map.d.ts +96 -0
- package/dist-pkg/input/face-map.js +255 -0
- package/dist-pkg/input/face-signals.d.ts +40 -0
- package/dist-pkg/input/face-signals.js +48 -0
- package/dist-pkg/input/gamepad.d.ts +195 -145
- package/dist-pkg/input/gamepad.js +383 -556
- package/dist-pkg/input/gaze-cycle.d.ts +64 -0
- package/dist-pkg/input/gaze-cycle.js +133 -0
- package/dist-pkg/input/gaze-relative.d.ts +68 -0
- package/dist-pkg/input/gaze-relative.js +142 -0
- package/dist-pkg/input/hand-map.d.ts +28 -0
- package/dist-pkg/input/hand-map.js +142 -0
- package/dist-pkg/input/input-cooldown.d.ts +17 -0
- package/dist-pkg/input/input-cooldown.js +39 -0
- package/dist-pkg/input/key-default.d.ts +30 -0
- package/dist-pkg/input/key-default.js +60 -0
- package/dist-pkg/input/keyboard-runtime.d.ts +15 -21
- package/dist-pkg/input/keyboard-runtime.js +23 -27
- package/dist-pkg/input/keyboard.d.ts +68 -63
- package/dist-pkg/input/keyboard.js +83 -105
- package/dist-pkg/input/keydown.d.ts +123 -137
- package/dist-pkg/input/keydown.js +284 -289
- package/dist-pkg/input/latch-edge.d.ts +33 -21
- package/dist-pkg/input/latch-edge.js +34 -35
- package/dist-pkg/input/latch-scope.d.ts +51 -50
- package/dist-pkg/input/latch-scope.js +61 -82
- package/dist-pkg/input/latch-store.d.ts +26 -30
- package/dist-pkg/input/latch-store.js +42 -50
- package/dist-pkg/input/latch-sync.d.ts +29 -29
- package/dist-pkg/input/latch-sync.js +25 -25
- package/dist-pkg/input/latch.d.ts +14 -17
- package/dist-pkg/input/latch.js +29 -37
- package/dist-pkg/input/pad-defaults.d.ts +13 -16
- package/dist-pkg/input/pad-defaults.js +21 -28
- package/dist-pkg/input/pad-reading.d.ts +76 -0
- package/dist-pkg/input/pad-reading.js +169 -0
- package/dist-pkg/input/pad-wizard.d.ts +99 -0
- package/dist-pkg/input/pad-wizard.js +256 -0
- package/dist-pkg/input/pointer-space.d.ts +19 -20
- package/dist-pkg/input/pointer-space.js +27 -32
- package/dist-pkg/input/pointer.d.ts +39 -40
- package/dist-pkg/input/pointer.js +42 -45
- package/dist-pkg/input/state.d.ts +101 -89
- package/dist-pkg/input/state.js +54 -134
- package/dist-pkg/input/switch-scan.d.ts +59 -0
- package/dist-pkg/input/switch-scan.js +67 -0
- package/dist-pkg/input/synthetic-source.d.ts +42 -0
- package/dist-pkg/input/synthetic-source.js +57 -0
- package/dist-pkg/input/touch-bindings.d.ts +127 -116
- package/dist-pkg/input/touch-bindings.js +158 -173
- package/dist-pkg/input/touch.d.ts +147 -72
- package/dist-pkg/input/touch.js +362 -126
- package/dist-pkg/input/transport-in-use.d.ts +107 -0
- package/dist-pkg/input/transport-in-use.js +130 -0
- package/dist-pkg/input/transports.d.ts +90 -117
- package/dist-pkg/input/transports.js +104 -106
- package/dist-pkg/input/virtual-controller.d.ts +82 -0
- package/dist-pkg/input/virtual-controller.js +69 -0
- package/dist-pkg/input/vocabulary-migration.d.ts +50 -49
- package/dist-pkg/input/vocabulary-migration.js +80 -79
- package/dist-pkg/input/voice-map.d.ts +59 -0
- package/dist-pkg/input/voice-map.js +123 -0
- package/dist-pkg/platform/audio-ambient.d.ts +13 -2
- package/dist-pkg/platform/audio-ambient.js +14 -14
- package/dist-pkg/platform/audio-earcons.d.ts +20 -19
- package/dist-pkg/platform/audio-earcons.js +51 -42
- package/dist-pkg/platform/audio-jingles.js +9 -10
- package/dist-pkg/platform/audio-mixer.d.ts +14 -2
- package/dist-pkg/platform/audio-mixer.js +31 -39
- package/dist-pkg/platform/audio-sonar.d.ts +49 -152
- package/dist-pkg/platform/audio-sonar.js +124 -302
- package/dist-pkg/platform/audio.d.ts +62 -19
- package/dist-pkg/platform/audio.js +193 -168
- package/dist-pkg/platform/choose-by-voice.d.ts +70 -0
- package/dist-pkg/platform/choose-by-voice.js +157 -0
- package/dist-pkg/platform/flash-sampler.d.ts +19 -0
- package/dist-pkg/platform/flash-sampler.js +79 -0
- package/dist-pkg/platform/font-library.d.ts +77 -0
- package/dist-pkg/platform/font-library.js +98 -0
- package/dist-pkg/platform/font-library.json +721 -0
- package/dist-pkg/platform/heavy-catalogue.d.ts +77 -0
- package/dist-pkg/platform/heavy-catalogue.js +256 -0
- package/dist-pkg/platform/heavy-mirror.d.ts +20 -0
- package/dist-pkg/platform/heavy-mirror.js +73 -0
- package/dist-pkg/platform/heavy.d.ts +136 -0
- package/dist-pkg/platform/heavy.js +324 -0
- package/dist-pkg/platform/interruptible-speech.d.ts +23 -16
- package/dist-pkg/platform/interruptible-speech.js +77 -54
- package/dist-pkg/platform/kokoro-port.d.ts +27 -0
- package/dist-pkg/platform/kokoro-port.js +50 -0
- package/dist-pkg/platform/kokoro-runtime.d.ts +20 -0
- package/dist-pkg/platform/kokoro-runtime.js +52 -0
- package/dist-pkg/platform/kokoro.d.ts +70 -0
- package/dist-pkg/platform/kokoro.js +133 -0
- package/dist-pkg/platform/listener-scope.d.ts +12 -0
- package/dist-pkg/platform/listener-scope.js +90 -0
- package/dist-pkg/platform/locale-host.d.ts +14 -0
- package/dist-pkg/platform/locale-host.js +45 -0
- package/dist-pkg/platform/microphone.d.ts +51 -0
- package/dist-pkg/platform/microphone.js +118 -0
- package/dist-pkg/platform/onnx-runtime.d.ts +34 -0
- package/dist-pkg/platform/onnx-runtime.js +42 -0
- package/dist-pkg/platform/reading-in-worker.d.ts +64 -0
- package/dist-pkg/platform/reading-in-worker.js +125 -0
- package/dist-pkg/platform/reading-model.d.ts +94 -0
- package/dist-pkg/platform/reading-model.js +272 -0
- package/dist-pkg/platform/reading-runtime.d.ts +24 -0
- package/dist-pkg/platform/reading-runtime.js +164 -0
- package/dist-pkg/platform/reading-worker.d.ts +41 -0
- package/dist-pkg/platform/reading-worker.js +58 -0
- package/dist-pkg/platform/reading.d.ts +80 -0
- package/dist-pkg/platform/reading.js +136 -0
- package/dist-pkg/platform/speech-recognition.d.ts +60 -0
- package/dist-pkg/platform/speech-recognition.js +104 -0
- package/dist-pkg/platform/speech.d.ts +23 -1
- package/dist-pkg/platform/speech.js +29 -18
- package/dist-pkg/platform/storage-keys.d.ts +96 -0
- package/dist-pkg/platform/storage-keys.js +106 -0
- package/dist-pkg/platform/storage.d.ts +46 -111
- package/dist-pkg/platform/storage.js +104 -169
- package/dist-pkg/platform/tts.d.ts +85 -39
- package/dist-pkg/platform/tts.js +447 -127
- package/dist-pkg/platform/vision-loop.d.ts +23 -0
- package/dist-pkg/platform/vision-loop.js +56 -0
- package/dist-pkg/platform/vision.d.ts +132 -0
- package/dist-pkg/platform/vision.js +117 -0
- package/dist-pkg/platform/voice-listener.d.ts +40 -0
- package/dist-pkg/platform/voice-listener.js +88 -0
- package/dist-pkg/platform/voice-plan.d.ts +15 -98
- package/dist-pkg/platform/voice-plan.js +56 -143
- package/dist-pkg/platform/vosk-runtime.d.ts +96 -0
- package/dist-pkg/platform/vosk-runtime.js +151 -0
- package/dist-pkg/platform/vosk-vocabulary.d.ts +6 -0
- package/dist-pkg/platform/vosk-vocabulary.js +178 -0
- package/dist-pkg/render/canvas.d.ts +13 -7
- package/dist-pkg/render/canvas.js +13 -13
- package/dist-pkg/render/crt.d.ts +48 -12
- package/dist-pkg/render/crt.js +78 -80
- package/dist-pkg/render/cvd-matrices.d.ts +22 -18
- package/dist-pkg/render/cvd-matrices.js +37 -38
- package/dist-pkg/render/hc-role-data.d.ts +7 -7
- package/dist-pkg/render/hc-role-data.js +14 -14
- package/dist-pkg/render/high-contrast.d.ts +67 -56
- package/dist-pkg/render/high-contrast.js +226 -217
- package/dist-pkg/render/low-vision-drawing.d.ts +5 -0
- package/dist-pkg/render/low-vision-drawing.js +46 -0
- package/dist-pkg/render/lq-filter.d.ts +32 -20
- package/dist-pkg/render/lq-filter.js +59 -65
- package/dist-pkg/render/port.d.ts +86 -88
- package/dist-pkg/render/port.js +17 -23
- package/dist-pkg/render/screen-pipeline.d.ts +42 -42
- package/dist-pkg/render/screen-pipeline.js +80 -87
- package/dist-pkg/render/sprite-fx.d.ts +2 -1
- package/dist-pkg/render/sprite-fx.js +16 -14
- package/dist-pkg/render/viewports.d.ts +20 -15
- package/dist-pkg/render/viewports.js +83 -114
- package/dist-pkg/render/viz-axes-labels.d.ts +47 -0
- package/dist-pkg/render/viz-axes-labels.js +88 -0
- package/dist-pkg/render/viz-axes.d.ts +89 -86
- package/dist-pkg/render/viz-axes.js +128 -116
- package/dist-pkg/render/viz-modes.d.ts +28 -29
- package/dist-pkg/render/viz-modes.js +40 -45
- package/dist-pkg/render/viz-refusal.d.ts +32 -0
- package/dist-pkg/render/viz-refusal.js +57 -0
- package/dist-pkg/render/viz-setters.d.ts +104 -66
- package/dist-pkg/render/viz-setters.js +182 -191
- package/dist-pkg/ui/aac-sets.d.ts +45 -0
- package/dist-pkg/ui/aac-sets.js +41 -0
- package/dist-pkg/ui/audio-choices.d.ts +68 -0
- package/dist-pkg/ui/audio-choices.js +98 -0
- package/dist-pkg/ui/audio-rows-that-apply.d.ts +12 -0
- package/dist-pkg/ui/audio-rows-that-apply.js +43 -0
- package/dist-pkg/ui/camera-control.d.ts +53 -0
- package/dist-pkg/ui/camera-control.js +48 -0
- package/dist-pkg/ui/changed-mark.d.ts +9 -8
- package/dist-pkg/ui/changed-mark.js +22 -53
- package/dist-pkg/ui/control-choices.d.ts +37 -0
- package/dist-pkg/ui/control-choices.js +84 -0
- package/dist-pkg/ui/debug-panel.d.ts +59 -43
- package/dist-pkg/ui/debug-panel.js +68 -69
- package/dist-pkg/ui/declared-words.d.ts +21 -0
- package/dist-pkg/ui/declared-words.js +66 -0
- package/dist-pkg/ui/dom.d.ts +10 -14
- package/dist-pkg/ui/dom.js +10 -47
- package/dist-pkg/ui/drawing-problems.d.ts +25 -0
- package/dist-pkg/ui/drawing-problems.js +94 -0
- package/dist-pkg/ui/eye-control.d.ts +36 -0
- package/dist-pkg/ui/eye-control.js +178 -0
- package/dist-pkg/ui/face-control.d.ts +25 -0
- package/dist-pkg/ui/face-control.js +183 -0
- package/dist-pkg/ui/focus-trap.d.ts +39 -49
- package/dist-pkg/ui/focus-trap.js +56 -65
- package/dist-pkg/ui/fonts.d.ts +157 -68
- package/dist-pkg/ui/fonts.js +305 -115
- package/dist-pkg/ui/footer-scroll-driver.d.ts +14 -0
- package/dist-pkg/ui/footer-scroll-driver.js +201 -0
- package/dist-pkg/ui/footer-scroll.d.ts +38 -0
- package/dist-pkg/ui/footer-scroll.js +55 -0
- package/dist-pkg/ui/game-options.d.ts +47 -0
- package/dist-pkg/ui/game-options.js +158 -0
- package/dist-pkg/ui/gaze-overlay.d.ts +64 -0
- package/dist-pkg/ui/gaze-overlay.js +165 -0
- package/dist-pkg/ui/hand-control.d.ts +25 -0
- package/dist-pkg/ui/hand-control.js +143 -0
- package/dist-pkg/ui/help-panel.d.ts +87 -0
- package/dist-pkg/ui/help-panel.js +242 -0
- package/dist-pkg/ui/hud-bands.d.ts +62 -0
- package/dist-pkg/ui/hud-bands.js +146 -0
- package/dist-pkg/ui/hud-row.d.ts +34 -0
- package/dist-pkg/ui/hud-row.js +80 -0
- package/dist-pkg/ui/hud.d.ts +73 -73
- package/dist-pkg/ui/hud.js +94 -98
- package/dist-pkg/ui/item-announcement.d.ts +13 -12
- package/dist-pkg/ui/item-announcement.js +25 -26
- package/dist-pkg/ui/layout.d.ts +103 -28
- package/dist-pkg/ui/layout.js +117 -99
- package/dist-pkg/ui/libras-avatar-clip.d.ts +30 -0
- package/dist-pkg/ui/libras-avatar-clip.js +86 -0
- package/dist-pkg/ui/libras-avatar-load.d.ts +52 -0
- package/dist-pkg/ui/libras-avatar-load.js +134 -0
- package/dist-pkg/ui/libras-avatar-plan.d.ts +102 -0
- package/dist-pkg/ui/libras-avatar-plan.js +211 -0
- package/dist-pkg/ui/libras-avatar-player.d.ts +28 -0
- package/dist-pkg/ui/libras-avatar-player.js +226 -0
- package/dist-pkg/ui/libras-avatar-stage.d.ts +37 -0
- package/dist-pkg/ui/libras-avatar-stage.js +208 -0
- package/dist-pkg/ui/libras-glosses.d.ts +28 -0
- package/dist-pkg/ui/libras-glosses.js +161 -0
- package/dist-pkg/ui/locale-flags.d.ts +16 -0
- package/dist-pkg/ui/locale-flags.js +30 -0
- package/dist-pkg/ui/loop-crash.d.ts +17 -17
- package/dist-pkg/ui/loop-crash.js +33 -62
- package/dist-pkg/ui/menu-intent.d.ts +61 -0
- package/dist-pkg/ui/menu-intent.js +88 -0
- package/dist-pkg/ui/menu-items.d.ts +20 -0
- package/dist-pkg/ui/menu-items.js +51 -0
- package/dist-pkg/ui/menu-nav.d.ts +98 -92
- package/dist-pkg/ui/menu-nav.js +398 -286
- package/dist-pkg/ui/mobility-choices.d.ts +26 -0
- package/dist-pkg/ui/mobility-choices.js +41 -0
- package/dist-pkg/ui/motion-choices.d.ts +31 -0
- package/dist-pkg/ui/motion-choices.js +68 -0
- package/dist-pkg/ui/motion-scene.d.ts +24 -19
- package/dist-pkg/ui/motion-scene.js +29 -61
- package/dist-pkg/ui/mount-panel.d.ts +81 -0
- package/dist-pkg/ui/mount-panel.js +61 -0
- package/dist-pkg/ui/panel-shell.d.ts +65 -31
- package/dist-pkg/ui/panel-shell.js +92 -66
- package/dist-pkg/ui/panel-widgets.d.ts +150 -0
- package/dist-pkg/ui/panel-widgets.js +294 -0
- package/dist-pkg/ui/pause-buttons.d.ts +35 -0
- package/dist-pkg/ui/pause-buttons.js +66 -0
- package/dist-pkg/ui/pause-icons.d.ts +261 -347
- package/dist-pkg/ui/pause-icons.js +671 -601
- package/dist-pkg/ui/pause-markup.d.ts +86 -0
- package/dist-pkg/ui/pause-markup.js +125 -0
- package/dist-pkg/ui/reach-notice.d.ts +22 -23
- package/dist-pkg/ui/reach-notice.js +55 -58
- package/dist-pkg/ui/scan-overlay.d.ts +23 -0
- package/dist-pkg/ui/scan-overlay.js +50 -0
- package/dist-pkg/ui/screen-text.d.ts +25 -0
- package/dist-pkg/ui/screen-text.js +152 -0
- package/dist-pkg/ui/session-clock.d.ts +32 -0
- package/dist-pkg/ui/session-clock.js +67 -0
- package/dist-pkg/ui/settings-aac.d.ts +70 -0
- package/dist-pkg/ui/settings-aac.js +208 -0
- package/dist-pkg/ui/settings-audio.d.ts +97 -114
- package/dist-pkg/ui/settings-audio.js +493 -425
- package/dist-pkg/ui/settings-controls.d.ts +53 -96
- package/dist-pkg/ui/settings-controls.js +143 -215
- package/dist-pkg/ui/settings-empathy.d.ts +39 -30
- package/dist-pkg/ui/settings-empathy.js +53 -60
- package/dist-pkg/ui/settings-mobility.d.ts +192 -0
- package/dist-pkg/ui/settings-mobility.js +332 -0
- package/dist-pkg/ui/settings-motion.d.ts +91 -70
- package/dist-pkg/ui/settings-motion.js +287 -198
- package/dist-pkg/ui/settings-panel.d.ts +58 -45
- package/dist-pkg/ui/settings-panel.js +189 -94
- package/dist-pkg/ui/settings-typo.d.ts +29 -78
- package/dist-pkg/ui/settings-typo.js +158 -129
- package/dist-pkg/ui/settings-visual.d.ts +29 -87
- package/dist-pkg/ui/settings-visual.js +240 -193
- package/dist-pkg/ui/shell.d.ts +112 -135
- package/dist-pkg/ui/shell.js +148 -217
- package/dist-pkg/ui/simulation-list.d.ts +27 -0
- package/dist-pkg/ui/simulation-list.js +76 -0
- package/dist-pkg/ui/simulation-over-the-world.d.ts +23 -0
- package/dist-pkg/ui/simulation-over-the-world.js +131 -0
- package/dist-pkg/ui/simulation-refusal.d.ts +5 -31
- package/dist-pkg/ui/simulation-refusal.js +8 -56
- package/dist-pkg/ui/switchable-control.d.ts +11 -0
- package/dist-pkg/ui/switchable-control.js +19 -0
- package/dist-pkg/ui/title.d.ts +3 -12
- package/dist-pkg/ui/title.js +49 -18
- package/dist-pkg/ui/top-band.d.ts +26 -0
- package/dist-pkg/ui/top-band.js +96 -0
- package/dist-pkg/ui/typo-choices.d.ts +71 -0
- package/dist-pkg/ui/typo-choices.js +85 -0
- package/dist-pkg/ui/visual-axes-panel.d.ts +11 -47
- package/dist-pkg/ui/visual-axes-panel.js +12 -94
- package/dist-pkg/ui/visual-choices.d.ts +77 -0
- package/dist-pkg/ui/visual-choices.js +107 -0
- package/dist-pkg/ui/vlibras.d.ts +77 -10
- package/dist-pkg/ui/vlibras.js +130 -81
- package/dist-pkg/ui/voice-control.d.ts +68 -0
- package/dist-pkg/ui/voice-control.js +276 -0
- package/dist-pkg/ui/voice-settings.d.ts +95 -0
- package/dist-pkg/ui/voice-settings.js +352 -0
- package/dist-pkg/ui/where-the-child-is.d.ts +31 -0
- package/dist-pkg/ui/where-the-child-is.js +70 -0
- package/docs/CREDITS.md +300 -44
- package/docs/LICENSES.md +189 -145
- package/package.json +51 -27
- package/scripts/check-cartridge.mjs +78 -0
- package/scripts/game-build.d.mts +25 -0
- package/scripts/game-build.mjs +144 -0
- package/scripts/heavy-into-the-delivery.mjs +388 -0
- package/scripts/libras-avatar.json +680 -0
- package/scripts/libras-avatar.mjs +246 -0
- package/scripts/libras-glosses/gloss.py +95 -0
- package/scripts/libras-glosses/pyproject.toml +32 -0
- package/scripts/libras-glosses/uv.lock +781 -0
- package/scripts/libras-glosses.mjs +351 -0
- package/scripts/licences/Apache-2.0.txt +176 -0
- package/scripts/licences/GPL-3.0.txt +674 -0
- package/scripts/licences/MIT.txt +17 -0
- package/scripts/licences/OFL-1.1.txt +86 -0
- package/scripts/licences/UFL-1.0.txt +96 -0
- package/scripts/licences/fonts.mjs +389 -0
- package/scripts/licences/third-party.mjs +301 -0
- package/scripts/licences/vosk-browser.NOTICE.txt +268 -0
- package/app/public/vendor/fonts/comicneue-400.woff2 +0 -0
- package/app/public/vendor/fonts/comicneue-700.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400-ext.woff2 +0 -0
- package/app/public/vendor/fonts/fondamento-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-400.woff2 +0 -0
- package/app/public/vendor/fonts/inter-700.woff2 +0 -0
- package/app/public/vendor/fonts/lato-400.woff2 +0 -0
- package/app/public/vendor/fonts/lato-700.woff2 +0 -0
- package/app/public/vendor/fonts/literata-400.woff2 +0 -0
- package/app/public/vendor/fonts/literata-700.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-400.woff2 +0 -0
- package/app/public/vendor/fonts/newsreader-700.woff2 +0 -0
- package/app/public/vendor/fonts/opendyslexic-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-400.woff2 +0 -0
- package/app/public/vendor/fonts/opensans-700.woff2 +0 -0
- package/app/public/vendor/fonts/pinyon-400.woff2 +0 -0
- package/app/public/vendor/fonts/pressstart-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-400.woff2 +0 -0
- package/app/public/vendor/fonts/quattro-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourcesans-700.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-400.woff2 +0 -0
- package/app/public/vendor/fonts/sourceserif-700.woff2 +0 -0
- package/app/public/vendor/fonts/ufmag-400.woff2 +0 -0
- package/dist-pkg/core/anel.d.ts +0 -17
- package/dist-pkg/core/anel.js +0 -31
- package/dist-pkg/core/collision.d.ts +0 -21
- package/dist-pkg/core/collision.js +0 -62
- package/dist-pkg/core/layers.d.ts +0 -63
- package/dist-pkg/core/layers.js +0 -95
- package/dist-pkg/core/letter-grid.d.ts +0 -55
- package/dist-pkg/core/letter-grid.js +0 -116
- package/dist-pkg/core/password.d.ts +0 -34
- package/dist-pkg/core/password.js +0 -205
- package/dist-pkg/core/rotulo-acessivel.d.ts +0 -17
- package/dist-pkg/core/rotulo-acessivel.js +0 -41
- package/dist-pkg/core/run-state.d.ts +0 -115
- package/dist-pkg/core/run-state.js +0 -40
- package/dist-pkg/core/tiles.d.ts +0 -12
- package/dist-pkg/core/tiles.js +0 -61
- package/dist-pkg/core/world.d.ts +0 -4
- package/dist-pkg/core/world.js +0 -58
- package/dist-pkg/input/origem-sintetica.d.ts +0 -44
- package/dist-pkg/input/origem-sintetica.js +0 -60
- package/dist-pkg/input/transporte-em-uso.d.ts +0 -101
- package/dist-pkg/input/transporte-em-uso.js +0 -130
- package/dist-pkg/platform/audio-nav.d.ts +0 -51
- package/dist-pkg/platform/audio-nav.js +0 -99
- package/dist-pkg/platform/guide-intensity.d.ts +0 -40
- package/dist-pkg/platform/guide-intensity.js +0 -73
- package/dist-pkg/platform/pesados-catalogo.d.ts +0 -14
- package/dist-pkg/platform/pesados-catalogo.js +0 -177
- package/dist-pkg/platform/pesados.d.ts +0 -31
- package/dist-pkg/platform/pesados.js +0 -75
- package/dist-pkg/platform/vozes-prontas.d.ts +0 -28
- package/dist-pkg/platform/vozes-prontas.js +0 -61
- package/dist-pkg/render/camera.d.ts +0 -58
- package/dist-pkg/render/camera.js +0 -105
- package/dist-pkg/render/cenario-data.d.ts +0 -127
- package/dist-pkg/render/cenario-data.js +0 -145
- package/dist-pkg/render/city-tex.d.ts +0 -63
- package/dist-pkg/render/city-tex.js +0 -228
- package/dist-pkg/render/city-tiles.d.ts +0 -11
- package/dist-pkg/render/city-tiles.js +0 -140
- package/dist-pkg/render/draw.d.ts +0 -149
- package/dist-pkg/render/draw.js +0 -231
- package/dist-pkg/render/fx.d.ts +0 -63
- package/dist-pkg/render/fx.js +0 -123
- package/dist-pkg/render/minimap.d.ts +0 -11
- package/dist-pkg/render/minimap.js +0 -94
- package/dist-pkg/render/parallax.d.ts +0 -85
- package/dist-pkg/render/parallax.js +0 -158
- package/dist-pkg/render/player-anim.d.ts +0 -71
- package/dist-pkg/render/player-anim.js +0 -152
- package/dist-pkg/render/recycling-tex.d.ts +0 -48
- package/dist-pkg/render/recycling-tex.js +0 -164
- package/dist-pkg/render/scene-city.d.ts +0 -77
- package/dist-pkg/render/scene-city.js +0 -181
- package/dist-pkg/render/scene-parallax.d.ts +0 -72
- package/dist-pkg/render/scene-parallax.js +0 -426
- package/dist-pkg/render/scene-sky.d.ts +0 -126
- package/dist-pkg/render/scene-sky.js +0 -295
- package/dist-pkg/render/set-cenario.d.ts +0 -54
- package/dist-pkg/render/set-cenario.js +0 -103
- package/dist-pkg/render/textures.d.ts +0 -75
- package/dist-pkg/render/textures.js +0 -240
- package/dist-pkg/render/title-scene.d.ts +0 -46
- package/dist-pkg/render/title-scene.js +0 -75
- package/dist-pkg/render/weather.d.ts +0 -96
- package/dist-pkg/render/weather.js +0 -171
- package/dist-pkg/render/wheelchair-sprites.d.ts +0 -32
- package/dist-pkg/render/wheelchair-sprites.js +0 -69
- package/dist-pkg/render/world-tex.d.ts +0 -18
- package/dist-pkg/render/world-tex.js +0 -87
- package/dist-pkg/ui/activities-menu.d.ts +0 -258
- package/dist-pkg/ui/activities-menu.js +0 -648
- package/dist-pkg/ui/caa-sets.d.ts +0 -39
- package/dist-pkg/ui/caa-sets.js +0 -65
- package/dist-pkg/ui/latch-refusal.d.ts +0 -32
- package/dist-pkg/ui/latch-refusal.js +0 -60
- package/dist-pkg/ui/map-hub.d.ts +0 -56
- package/dist-pkg/ui/map-hub.js +0 -138
- package/dist-pkg/ui/settings-caa.d.ts +0 -45
- package/dist-pkg/ui/settings-caa.js +0 -137
- package/dist-pkg/ui/settings-motor.d.ts +0 -175
- package/dist-pkg/ui/settings-motor.js +0 -342
- package/dist-pkg/ui/webcam.d.ts +0 -7
- package/dist-pkg/ui/webcam.js +0 -93
package/dist-pkg/core/route.js
CHANGED
|
@@ -1,158 +1,163 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// core/route —
|
|
2
|
+
// core/route — WHICH WAY TO GET THERE, not only where there is (#84, item 1).
|
|
3
3
|
//
|
|
4
|
-
// =========================
|
|
5
|
-
//
|
|
4
|
+
// ========================= THE DEFECT THIS EXISTS TO FIX =========================
|
|
5
|
+
// Without it, every cue points in a STRAIGHT LINE at the target, and a straight line goes through walls: the guide
|
|
6
|
+
// tells the child to walk into a solid block, and they have no way to know why.
|
|
6
7
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
8
|
+
// ⚠️ AND THEY REALLY HAVE NO WAY TO KNOW. A child who can see ignores an arrow pointing at a wall without noticing they
|
|
9
|
+
// ignored it. A child who depends on the cue does what it says — and then does it again, because the cue keeps saying
|
|
10
|
+
// the same. A wrong cue is worse than none: no cue at least lets them explore.
|
|
10
11
|
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
12
|
+
// ========================= WHAT "CROSSABLE" IS, AND WHY IT IS NOT MY INVENTION =========================
|
|
13
|
+
// #84 asks for "the directions where there is AIR OR WATER". Those two words are already in the contract, and each
|
|
14
|
+
// `Role` says of itself whether it can be crossed — the set below is a READING of `core/contract`, not a new decision:
|
|
14
15
|
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
16
|
+
// free crossable, with no meaning of its own → the air
|
|
17
|
+
// water crossed by swimming → the water
|
|
18
|
+
// climb height changes by interacting with it → the ladder: it is BY it that one climbs
|
|
19
|
+
// key satisfies a gate → an object lying there, not a barrier
|
|
20
|
+
// structure scenery: floor, wall, what holds things up → NO
|
|
21
|
+
// gate bars until a condition → NO: barring is what it does
|
|
22
|
+
// hazard hurts on contact → NO, and it is the only one I chose
|
|
23
|
+
// goal what the round asks for → a case apart, see `targets` below
|
|
18
24
|
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// key «satisfaz um gate» → um objeto pousado, não uma barreira
|
|
23
|
-
// structure «cenário: chão, parede, o que sustenta» → NÃO
|
|
24
|
-
// gate «barra até uma condição» → NÃO: barrar é o que ele faz
|
|
25
|
-
// hazard «machuca ao encostar» → NÃO, e é a única onde eu escolhi
|
|
26
|
-
// goal «o que a rodada pede» → caso à parte, ver `alvo` abaixo
|
|
25
|
+
// ⚠️ `hazard` IS THE CHOICE, and I declare it: its metric does not say whether it can be crossed, it says what it
|
|
26
|
+
// costs. A route over a spike is a route that sends the child into damage. A game where the spike is a compulsory
|
|
27
|
+
// passage will have to say so another way; none does today.
|
|
27
28
|
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// terá de dizê-lo por outro meio; hoje nenhum diz.
|
|
29
|
+
// ========================= THE TARGET IS ALWAYS STEPPABLE, THE PATH IS NOT =========================
|
|
30
|
+
// A `goal` may be declared on a cell that cannot be crossed (a flag inside a gate). Refusing to enter it would make
|
|
31
|
+
// the route never arrive anywhere. The rule is asymmetric on purpose: **the last step is always allowed; the ones in
|
|
32
|
+
// between obey the set.** It is the difference between "entering the gate" and "crossing the gate to go on".
|
|
33
33
|
//
|
|
34
|
-
// =========================
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
34
|
+
// ========================= THE BUDGET, WHICH THE CONTRACT ITSELF ASKED FOR =========================
|
|
35
|
+
// ⚠️ `core/contract` warns, in its section 5, that in a CONTINUOUS space the spots cannot be enumerated, and on a large
|
|
36
|
+
// map enumerating would cost a frame. This module cannot ignore that because it is convenient. So it has a CEILING of
|
|
37
|
+
// visited cells and returns `null` when it is hit. `null` means **"I cannot say"**, not "there is no path" — a caller
|
|
38
|
+
// has to treat both alike, which is what an honest cue does: it goes quiet.
|
|
39
39
|
//
|
|
40
|
-
//
|
|
41
|
-
// ⚠️ `core/contract` avisa, na sua secção 5: «num espaço CONTÍNUO não há como enumerar os pontos, e num mapa
|
|
42
|
-
// grande enumerar seria caro por quadro». Este módulo não pode ignorar esse aviso só porque é conveniente.
|
|
43
|
-
// Por isso tem TETO de células visitadas e devolve `null` ao estourá-lo. `null` quer dizer **«não sei»**, e
|
|
44
|
-
// não «não há caminho» — quem chamar tem de tratar os dois iguais, que é o que uma pista honesta faz: cala-se.
|
|
45
|
-
//
|
|
46
|
-
// E não importa nada além do contrato: é lógica pura, aferida no project `node`.
|
|
40
|
+
// And it imports nothing but the contract: pure logic, measured in the `node` project.
|
|
47
41
|
import { distance } from './contract.js';
|
|
48
42
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
43
|
+
* The roles a route crosses. A reading of `core/contract`, with `hazard` left out by the decision declared in the
|
|
44
|
+
* header — and `goal` left out because it comes in by the last-step rule, not the in-between one.
|
|
51
45
|
*/
|
|
52
|
-
export const
|
|
53
|
-
/**
|
|
54
|
-
export function
|
|
55
|
-
return
|
|
46
|
+
export const WALKABLE_ROLES = new Set(['free', 'water', 'climb', 'key']);
|
|
47
|
+
/** Does this role let one through? */
|
|
48
|
+
export function isWalkable(role) {
|
|
49
|
+
return WALKABLE_ROLES.has(role);
|
|
56
50
|
}
|
|
57
|
-
const
|
|
58
|
-
/**
|
|
59
|
-
const
|
|
51
|
+
const DEFAULT_BUDGET = 4096;
|
|
52
|
+
/** A spot's key in the queue. Rounded, because in continuous space spots are born from sums of `stride`. */
|
|
53
|
+
const key = (s, cells) => s.x.toFixed(cells) + '|' + s.y.toFixed(cells) + '|' + (s.z ?? 0).toFixed(cells);
|
|
60
54
|
/**
|
|
61
|
-
*
|
|
55
|
+
* The offsets of ONE step, in the declared metric.
|
|
62
56
|
*
|
|
63
|
-
* ⚠️ `free` (L²,
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* medida física.
|
|
57
|
+
* ⚠️ `free` (L², continuous space with no discrete step) HAS NO NEIGHBOURS — and pretending it does is the
|
|
58
|
+
* approximation this module makes and declares: it walks a GRID of side `unit`, in eight directions. The alternative
|
|
59
|
+
* would be answering nothing in a platform game, which is exactly the issue's genre. Whoever reads a `free` route is
|
|
60
|
+
* reading a sampling, not a trajectory — which is why `steps` is a count of cells and not a physical measure.
|
|
68
61
|
*/
|
|
69
|
-
function
|
|
70
|
-
if (
|
|
62
|
+
function neighbours(shape, stride) {
|
|
63
|
+
if (shape.kind === 'hotspots')
|
|
71
64
|
return [];
|
|
72
|
-
const dims =
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
for (const dx of
|
|
77
|
-
for (const dy of
|
|
78
|
-
for (const dz of dims > 2 ?
|
|
65
|
+
const dims = shape.size.length;
|
|
66
|
+
const orthogonal = shape.move === 'orthogonal';
|
|
67
|
+
const out = [];
|
|
68
|
+
const axes = [-1, 0, 1];
|
|
69
|
+
for (const dx of axes)
|
|
70
|
+
for (const dy of axes) {
|
|
71
|
+
for (const dz of dims > 2 ? axes : [0]) {
|
|
79
72
|
const n = Math.abs(dx) + Math.abs(dy) + Math.abs(dz);
|
|
80
73
|
if (n === 0)
|
|
81
74
|
continue;
|
|
82
|
-
if (
|
|
83
|
-
continue; // L¹:
|
|
84
|
-
|
|
75
|
+
if (orthogonal && n > 1)
|
|
76
|
+
continue; // L¹: there is no diagonal
|
|
77
|
+
out.push({ x: dx * stride, y: dy * stride, z: dz * stride });
|
|
85
78
|
}
|
|
86
79
|
}
|
|
87
|
-
return
|
|
80
|
+
return out;
|
|
88
81
|
}
|
|
89
|
-
/**
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
82
|
+
/** Does the spot fit the declared extent? A grid counts cells 0..n−1; continuous space counts units 0..n. */
|
|
83
|
+
function isInside(shape, s) {
|
|
84
|
+
if (shape.kind === 'hotspots')
|
|
92
85
|
return false;
|
|
93
|
-
const
|
|
94
|
-
for (let i = 0; i <
|
|
95
|
-
const lim =
|
|
96
|
-
if (
|
|
86
|
+
const axis = [s.x, s.y, s.z ?? 0];
|
|
87
|
+
for (let i = 0; i < shape.size.length; i++) {
|
|
88
|
+
const lim = shape.size[i];
|
|
89
|
+
if (axis[i] < 0)
|
|
97
90
|
return false;
|
|
98
|
-
if (
|
|
91
|
+
if (shape.kind === 'grid' ? axis[i] > lim - 1 : axis[i] > lim)
|
|
99
92
|
return false;
|
|
100
93
|
}
|
|
101
94
|
return true;
|
|
102
95
|
}
|
|
103
96
|
/**
|
|
104
|
-
*
|
|
97
|
+
* The route from `de` to the nearest REACHABLE of the `targets` — breadth first, over what can be crossed.
|
|
105
98
|
*
|
|
106
|
-
* `null`
|
|
107
|
-
*
|
|
99
|
+
* `null` when there is no target, when none is reachable, when the topology has no space (`hotspots`), or when the
|
|
100
|
+
* budget ran out. The four cases are one for the caller: **I cannot say which way**.
|
|
108
101
|
*
|
|
109
|
-
* ⚠️
|
|
110
|
-
*
|
|
111
|
-
*
|
|
102
|
+
* ⚠️ "NEAREST" HERE IS ALONG THE PATH, and that is the whole difference. A target three cells away in a straight line
|
|
103
|
+
* on the other side of a wall is FARTHER than one eight cells down an open corridor — and it is the second one the
|
|
104
|
+
* child can reach.
|
|
112
105
|
*/
|
|
113
|
-
export function
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
106
|
+
export function routeTo(ctx, de, targets) {
|
|
107
|
+
const shape = ctx.topology;
|
|
108
|
+
if (shape.kind === 'hotspots' || targets.length === 0)
|
|
116
109
|
return null;
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
for (const d of saltos) {
|
|
136
|
-
const vizinho = { x: item.at.x + d.x, y: item.at.y + d.y, z: (item.at.z ?? 0) + (d.z ?? 0) };
|
|
137
|
-
if (!dentro(topo, vizinho))
|
|
138
|
-
continue;
|
|
139
|
-
const k = chave(vizinho, casas);
|
|
140
|
-
if (vistos.has(k))
|
|
141
|
-
continue;
|
|
142
|
-
vistos.add(k);
|
|
143
|
-
if (vistos.size > teto)
|
|
144
|
-
return null; // «não sei», e é uma resposta
|
|
145
|
-
const primeiro = item.passos === 0 ? vizinho : item.primeiro;
|
|
146
|
-
// O ÚLTIMO PASSO É SEMPRE PERMITIDO: um alvo pode estar declarado numa célula que não se atravessa.
|
|
147
|
-
const alvo = chegou(vizinho);
|
|
148
|
-
if (alvo)
|
|
149
|
-
return { proximo: primeiro, ate: alvo, passos: item.passos + 1 };
|
|
150
|
-
if (!atravessavel(ctx.roleAt(vizinho)))
|
|
151
|
-
continue;
|
|
152
|
-
proxima.push({ at: vizinho, primeiro, passos: item.passos + 1 });
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
fila = proxima;
|
|
110
|
+
const walk = walkOf(shape);
|
|
111
|
+
// a unit of zero would make the queue go nowhere, and a negative one would walk exactly like a positive one
|
|
112
|
+
if (!(walk.step > 0))
|
|
113
|
+
return null;
|
|
114
|
+
const arrived = (s) => targets.find((a) => distance(shape, s, a) <= walk.tolerance) ?? null;
|
|
115
|
+
const targetHere = arrived(de);
|
|
116
|
+
if (targetHere)
|
|
117
|
+
return { next: de, reached: targetHere, steps: 0 };
|
|
118
|
+
const search = {
|
|
119
|
+
ctx, space: shape, arrived, keyDecimals: walk.keyDecimals, jumps: neighbours(shape, walk.step),
|
|
120
|
+
budget: ctx.budget ?? DEFAULT_BUDGET, seen: new Set([key(de, walk.keyDecimals)]),
|
|
121
|
+
};
|
|
122
|
+
let level = [{ at: de, first: de, steps: 0 }];
|
|
123
|
+
while (level.length) {
|
|
124
|
+
const next = nextLevel(search, level);
|
|
125
|
+
if (!Array.isArray(next))
|
|
126
|
+
return next;
|
|
127
|
+
level = next;
|
|
156
128
|
}
|
|
157
129
|
return null;
|
|
158
130
|
}
|
|
131
|
+
/** How a space is walked: the step, the decimals a point's key keeps, and how close counts as arrived. On a grid it is the
|
|
132
|
+
* same cell; in a continuous space half a step, because the sampling grid does not fall on the target. */
|
|
133
|
+
function walkOf(space) {
|
|
134
|
+
return space.kind === 'continuous' ? { step: space.unit, keyDecimals: 4, tolerance: 0.5 } : { step: 1, keyDecimals: 0, tolerance: 0 };
|
|
135
|
+
}
|
|
136
|
+
/** Where one jump from a point lands, on every axis the space has. */
|
|
137
|
+
const stepFrom = (at, d) => ({ x: at.x + d.x, y: at.y + d.y, z: (at.z ?? 0) + (d.z ?? 0) });
|
|
138
|
+
/** One ring further out. A route when a target is reached, `null` when the budget ran out («I cannot say», which is an
|
|
139
|
+
* answer), or the next ring. */
|
|
140
|
+
function nextLevel(s, level) {
|
|
141
|
+
const next = [];
|
|
142
|
+
for (const item of level) {
|
|
143
|
+
for (const d of s.jumps) {
|
|
144
|
+
const neighbour = stepFrom(item.at, d);
|
|
145
|
+
if (!isInside(s.space, neighbour))
|
|
146
|
+
continue;
|
|
147
|
+
const k = key(neighbour, s.keyDecimals);
|
|
148
|
+
if (s.seen.has(k))
|
|
149
|
+
continue;
|
|
150
|
+
s.seen.add(k);
|
|
151
|
+
if (s.seen.size > s.budget)
|
|
152
|
+
return null;
|
|
153
|
+
const first = item.steps === 0 ? neighbour : item.first;
|
|
154
|
+
// THE LAST STEP IS ALWAYS ALLOWED: a target may be declared on a cell that cannot be crossed.
|
|
155
|
+
const target = s.arrived(neighbour);
|
|
156
|
+
if (target)
|
|
157
|
+
return { next: first, reached: target, steps: item.steps + 1 };
|
|
158
|
+
if (isWalkable(s.ctx.roleAt(neighbour)))
|
|
159
|
+
next.push({ at: neighbour, first, steps: item.steps + 1 });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return next;
|
|
163
|
+
}
|
|
@@ -1,68 +1,65 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* A scene. Every hook is OPTIONAL on purpose: a title screen that only draws should not have to declare an empty
|
|
4
|
+
* `update`, and a dialog that only listens should not have to declare a `draw`.
|
|
5
5
|
*/
|
|
6
6
|
export interface Scene {
|
|
7
|
-
/**
|
|
8
|
-
readonly
|
|
9
|
-
/**
|
|
7
|
+
/** A readable name — for debugging, and so tests assert the stack by name, not identity. */
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/** Called on ENTERING (push, or reappearing on top after a pop). */
|
|
10
10
|
enter?(): void;
|
|
11
|
-
/**
|
|
11
|
+
/** Called on LEAVING (pop, or being covered by a push). */
|
|
12
12
|
exit?(): void;
|
|
13
|
-
/**
|
|
13
|
+
/** Time. Only the top gets it. */
|
|
14
14
|
update?(dt: number): void;
|
|
15
|
-
/**
|
|
15
|
+
/** Drawing. All get it, bottom up. */
|
|
16
16
|
draw?(): void;
|
|
17
|
-
/**
|
|
17
|
+
/** Input. Only the top gets it. Return `true` if consumed — `false`/nothing lets the key go on. */
|
|
18
18
|
input?(intent: string): boolean | void;
|
|
19
19
|
}
|
|
20
20
|
export interface SceneStack {
|
|
21
|
-
/**
|
|
21
|
+
/** Pushes `s` on top. The previous one gets `exit()` but STAYS on the stack (and is still drawn). */
|
|
22
22
|
push(s: Scene): void;
|
|
23
|
-
/**
|
|
23
|
+
/** Pops the top and returns it (or `null` if empty). Whoever reappears gets `enter()`. */
|
|
24
24
|
pop(): Scene | null;
|
|
25
|
-
/**
|
|
25
|
+
/** Swaps the top — `pop` then `push` in one call, because that is what "go to another screen" means. */
|
|
26
26
|
replace(s: Scene): void;
|
|
27
|
-
/**
|
|
27
|
+
/** The top scene, or `null`. */
|
|
28
28
|
top(): Scene | null;
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/** The names, bottom to top. A copy: whoever reads cannot mutate the stack by accident. */
|
|
30
|
+
names(): string[];
|
|
31
31
|
update(dt: number): void;
|
|
32
32
|
draw(): void;
|
|
33
|
-
/**
|
|
33
|
+
/** Returns `true` if the top scene consumed the intent. */
|
|
34
34
|
input(intent: string): boolean;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Creates an empty stack.
|
|
38
38
|
*
|
|
39
|
-
* ⚠️ `enter`/`exit`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
39
|
+
* ⚠️ Are `enter`/`exit` called inside TRY/CATCH? NO — and it is a decision, not an oversight. An error inside `enter()`
|
|
40
|
+
* means the scene did not mount; swallowing it would leave the stack in a state nobody declared, and the symptom would
|
|
41
|
+
* show three frames later, far from the cause. `update`/`draw`/`input` propagate too: the engine is not the place to
|
|
42
|
+
* decide that a game's error does not matter.
|
|
43
43
|
*/
|
|
44
|
-
export declare function
|
|
44
|
+
export declare function createSceneStack(): SceneStack;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* WHAT THE SHELL NEEDS TO KNOW ABOUT THE SCENE — three booleans, and no phase name.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
49
|
-
* união como NÃO-OPÇÃO, e a razão é curta: um segundo jogo continuaria amarrado ao NOSSO vocabulário — um
|
|
50
|
-
* jogo com mapa de fases ou tela de resultados teria de pedir uma constante nova à engine para existir.
|
|
48
|
+
* It was a `Phase` union. Widening it is a NON-OPTION (ADR-0030): a second game would stay tied to OUR vocabulary.
|
|
51
49
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* erro a não repetir. Isto aqui é a mesma correção, aplicada à casca inteira.
|
|
50
|
+
* And the repository already learned this once, by evidence and not taste: the demo quiz had to declare itself
|
|
51
|
+
* "paused" to walk its own menus, because the menu navigation imported the phase. The fix there was a BOOLEAN,
|
|
52
|
+
* `isNavigable()`. This is the same fix, applied to the whole shell.
|
|
56
53
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
54
|
+
* Whoever NAMES the scenes is the composition root. It builds the stack and translates the top into these three facts.
|
|
55
|
+
* A fourth scene the shell does not know answers `false` to all three, and the projection still makes sense: no splash,
|
|
56
|
+
* no pause menu, sound muted, focus on the title.
|
|
60
57
|
*/
|
|
61
|
-
export interface
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
|
|
58
|
+
export interface SceneFacts {
|
|
59
|
+
/** The top is the title screen (the splash covers the world). */
|
|
60
|
+
titleScreen: boolean;
|
|
61
|
+
/** The top is the GAME — the world gets time, sound plays, the touch pad may appear. */
|
|
62
|
+
worldRunning: boolean;
|
|
63
|
+
/** The top is the pause menu. The game stays on the stack below, still drawn. */
|
|
64
|
+
pauseMenu: boolean;
|
|
68
65
|
}
|
package/dist-pkg/core/scenes.js
CHANGED
|
@@ -1,64 +1,62 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
// core/scenes —
|
|
2
|
+
// core/scenes — THE SCENE STACK (item 22, option C3 of ADR-0030). A LEAF module: no dependencies, no I/O.
|
|
3
3
|
//
|
|
4
|
-
// =========================
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// precisariam pedir uma constante nova na engine para existir.
|
|
4
|
+
// ========================= WHAT IT REPLACES, AND WHY IT IS NOT A BIGGER ENUM =========================
|
|
5
|
+
// A `phase: 'title' | 'playing' | 'paused'` union is a vocabulary, and ADR-0030 records widening it (C1) as a
|
|
6
|
+
// NON-OPTION for a short reason: a second game would stay tied to OUR enum. A game with a map screen, one with a
|
|
7
|
+
// results screen, one with a password between sessions would each have to ask the engine for a new constant to exist.
|
|
9
8
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
9
|
+
// A STACK does not have that problem because it has no vocabulary: it knows scenes are stacked and nothing about what
|
|
10
|
+
// each means. `title/playing/paused` becomes `[title]`, `[game]`, `[game, pause]` — and a level map becomes `[map]`
|
|
11
|
+
// without this file changing a line.
|
|
13
12
|
//
|
|
14
|
-
// =========================
|
|
15
|
-
//
|
|
13
|
+
// ========================= THE THREE RULES, AND WHAT EACH PRESERVES =========================
|
|
14
|
+
// They are not library convention: each reproduces a behaviour the game already has.
|
|
16
15
|
//
|
|
17
|
-
// · `update`
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// está por cima decide, e o que ele não quer volta a descer. Sem o retorno, a pilha teria de adivinhar.
|
|
16
|
+
// · `update` ONLY AT THE TOP. It is the pause freeze — structural here: a scene that is not on top gets no time.
|
|
17
|
+
// · `draw` FROM THE BOTTOM UP. It is the pause menu drawn OVER the world, with the world still visible. Drawing only
|
|
18
|
+
// the top would make pausing erase the game from the screen.
|
|
19
|
+
// · `input` ONLY AT THE TOP, and it SAYS whether it consumed. The shape ADR-0033 gave modal input: whoever is on
|
|
20
|
+
// top decides, and what they do not want goes back down. Without the return value the stack would have to guess.
|
|
23
21
|
//
|
|
24
|
-
// =========================
|
|
25
|
-
//
|
|
26
|
-
//
|
|
22
|
+
// ========================= WHAT IT DOES NOT DO =========================
|
|
23
|
+
// It does not draw, listen for events, or know PIXI or the DOM. It takes `dt` and returns nothing; it takes an intent
|
|
24
|
+
// and returns a boolean. That is what makes it testable without a browser and importable from both sides of the boundary.
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
26
|
+
* Creates an empty stack.
|
|
29
27
|
*
|
|
30
|
-
* ⚠️ `enter`/`exit`
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
28
|
+
* ⚠️ Are `enter`/`exit` called inside TRY/CATCH? NO — and it is a decision, not an oversight. An error inside `enter()`
|
|
29
|
+
* means the scene did not mount; swallowing it would leave the stack in a state nobody declared, and the symptom would
|
|
30
|
+
* show three frames later, far from the cause. `update`/`draw`/`input` propagate too: the engine is not the place to
|
|
31
|
+
* decide that a game's error does not matter.
|
|
34
32
|
*/
|
|
35
|
-
export function
|
|
36
|
-
const
|
|
33
|
+
export function createSceneStack() {
|
|
34
|
+
const stack = [];
|
|
37
35
|
return {
|
|
38
36
|
push(s) {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
stack[stack.length - 1]?.exit?.();
|
|
38
|
+
stack.push(s);
|
|
41
39
|
s.enter?.();
|
|
42
40
|
},
|
|
43
41
|
pop() {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
42
|
+
const out = stack.pop() ?? null;
|
|
43
|
+
out?.exit?.();
|
|
44
|
+
stack[stack.length - 1]?.enter?.();
|
|
45
|
+
return out;
|
|
48
46
|
},
|
|
49
47
|
replace(s) {
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
// NOT `this.pop()` then `this.push(s)`: that would give the scene below an `enter()` for an instant, and it
|
|
49
|
+
// would reappear on top between the two calls. Swapping is ONE transition, not two.
|
|
50
|
+
const out = stack.pop() ?? null;
|
|
51
|
+
out?.exit?.();
|
|
52
|
+
stack.push(s);
|
|
55
53
|
s.enter?.();
|
|
56
54
|
},
|
|
57
|
-
top() { return
|
|
58
|
-
|
|
59
|
-
update(dt) {
|
|
60
|
-
draw() { for (const s of
|
|
55
|
+
top() { return stack[stack.length - 1] ?? null; },
|
|
56
|
+
names() { return stack.map((s) => s.name); },
|
|
57
|
+
update(dt) { stack[stack.length - 1]?.update?.(dt); },
|
|
58
|
+
draw() { for (const s of stack)
|
|
61
59
|
s.draw?.(); },
|
|
62
|
-
input(intent) { return
|
|
60
|
+
input(intent) { return stack[stack.length - 1]?.input?.(intent) === true; },
|
|
63
61
|
};
|
|
64
62
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
/**
|
|
2
|
+
/** Columns and rows of the grid for `n` screens. */
|
|
3
3
|
export interface ScreenGrid {
|
|
4
4
|
cols: number;
|
|
5
5
|
rows: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* `n`
|
|
8
|
+
* The grid for `n` players: 1 -> 1x1 · 2 -> 2x1 · 3 and 4 -> 2x2.
|
|
9
|
+
* `n` below 1 gives the grid of one screen, not zero columns.
|
|
10
10
|
*/
|
|
11
11
|
export declare function screenGrid(n: number): ScreenGrid;
|
|
12
|
-
/**
|
|
12
|
+
/** Size in art pixels of the grid of `n` screens (320x180 per screen — the canonical pixel of ADR-0010). */
|
|
13
13
|
export declare function screenBaseSize(n: number): {
|
|
14
14
|
w: number;
|
|
15
15
|
h: number;
|