@auraindustry/aurajs 0.0.6 → 0.1.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 +103 -7
- package/benchmarks/perf-thresholds.json +54 -0
- package/package.json +4 -7
- package/src/asset-pack.mjs +5 -1
- package/src/authored-project.mjs +1449 -0
- package/src/authored-runtime.mjs +2016 -0
- package/src/authoring/avatar-animation-graph.mjs +648 -0
- package/src/bin-integrity.mjs +272 -0
- package/src/build-contract/assets.mjs +130 -0
- package/src/build-contract/capabilities.mjs +116 -0
- package/src/build-contract/constants.mjs +6 -0
- package/src/build-contract/helpers.mjs +44 -0
- package/src/build-contract/web-templates.mjs +5993 -0
- package/src/build-contract.mjs +27 -2910
- package/src/bundler.mjs +188 -55
- package/src/cli.mjs +4825 -1512
- package/src/commands/project-authoring.mjs +434 -0
- package/src/config.mjs +27 -0
- package/src/conformance/cases/app-and-ui-runtime-cases.mjs +3309 -0
- package/src/conformance/cases/core-runtime-cases.mjs +1431 -0
- package/src/conformance/cases/index.mjs +11 -0
- package/src/conformance/cases/scene3d-and-media-cases.mjs +2094 -0
- package/src/conformance/cases/systems-and-gameplay-cases.mjs +1776 -0
- package/src/conformance/shared.mjs +27 -0
- package/src/conformance-runner.mjs +25 -13
- package/src/conformance.mjs +619 -4020
- package/src/cutscene.mjs +362 -5
- package/src/dev-cli-action.mjs +249 -0
- package/src/dev-cli-inspect.mjs +92 -0
- package/src/dev-cli-state.mjs +80 -0
- package/src/external-asset-cache.mjs +587 -0
- package/src/external-asset-policy.mjs +217 -0
- package/src/external-package-surface.mjs +206 -0
- package/src/game-action-runtime.mjs +869 -0
- package/src/game-state-runtime.mjs +206 -6
- package/src/headless-action.mjs +186 -0
- package/src/headless-test/runtime-animation.mjs +1173 -0
- package/src/headless-test/runtime-coordinator.mjs +1514 -0
- package/src/headless-test/runtime-primitives.mjs +320 -0
- package/src/headless-test/runtime-world.mjs +2253 -0
- package/src/headless-test.mjs +392 -4298
- package/src/host-binary.mjs +342 -14
- package/src/icon-discovery.mjs +64 -0
- package/src/make-catalog.mjs +109 -0
- package/src/make.mjs +197 -0
- package/src/package-integrity.mjs +586 -0
- package/src/perf-benchmark.mjs +353 -0
- package/src/postinstall.mjs +5 -5
- package/src/prefabs/index.mjs +34 -0
- package/src/prefabs/scene-serialization.mjs +184 -0
- package/src/project-importer.mjs +620 -0
- package/src/project-registry.mjs +24 -0
- package/src/publish-command.mjs +195 -0
- package/src/publish-env-example.mjs +83 -0
- package/src/publish-validation.mjs +708 -0
- package/src/retro/assets/compile.mjs +232 -0
- package/src/retro/backend-gba/authoring.mjs +1029 -0
- package/src/retro/backend-gba/rom.mjs +363 -0
- package/src/retro/backend-gbc/rom.mjs +85 -0
- package/src/retro/build.mjs +278 -0
- package/src/retro/cli/commands.mjs +292 -0
- package/src/retro/cli/templates.mjs +84 -0
- package/src/retro/diagnostics/catalog.mjs +110 -0
- package/src/retro/diagnostics/emit.mjs +72 -0
- package/src/retro/emulator/case-overlay.mjs +64 -0
- package/src/retro/emulator/discovery.mjs +158 -0
- package/src/retro/emulator/macos-case-overlay.swift +220 -0
- package/src/retro/emulator/profiles.mjs +146 -0
- package/src/retro/emulator/runner.mjs +289 -0
- package/src/retro/frontend/load-project.mjs +98 -0
- package/src/retro/index.mjs +30 -0
- package/src/retro/ir/build-ir.mjs +108 -0
- package/src/retro/runtime-gba/contract.mjs +151 -0
- package/src/retro/runtime-gbc/contract.mjs +117 -0
- package/src/retro/shared/span.mjs +26 -0
- package/src/retro/shared/targets.mjs +64 -0
- package/src/retro/validator/check-project.mjs +114 -0
- package/src/runtime-hotspot-audit.mjs +707 -0
- package/src/scaffold/config.mjs +1000 -0
- package/src/scaffold/fs.mjs +56 -0
- package/src/scaffold/layout.mjs +318 -0
- package/src/scaffold/project-docs.mjs +438 -0
- package/src/scaffold.mjs +93 -596
- package/src/scene-composition/index.mjs +326 -0
- package/src/scene-composition/runtime.mjs +751 -0
- package/src/self-hosted-assets.mjs +604 -0
- package/src/session-client.mjs +750 -0
- package/src/session-native-launcher.mjs +74 -0
- package/src/session-protocol.mjs +75 -0
- package/src/session-runtime.mjs +321 -0
- package/src/session-server.mjs +360 -0
- package/src/shader-kits/index.mjs +773 -0
- package/src/starter-content-registry.mjs +292 -0
- package/src/state-artifacts.mjs +662 -24
- package/src/state-dev-reload.mjs +99 -2
- package/src/terminal-ui.mjs +245 -0
- package/src/web-conformance.mjs +219 -0
- package/templates/create/2d/config/gameplay/shooter.config.js +26 -0
- package/templates/create/2d/content/gameplay/waves.json +26 -0
- package/templates/create/2d/content/registries/.gitkeep +1 -0
- package/templates/create/2d/docs/design/.gitkeep +1 -0
- package/templates/create/2d/docs/design/loop.md +5 -0
- package/templates/create/2d/prefabs/enemies.prefab.js +90 -0
- package/templates/create/2d/prefabs/enemy-basic.prefab.js +18 -0
- package/templates/create/2d/prefabs/player.prefab.js +36 -0
- package/templates/create/2d/prefabs/projectiles.prefab.js +35 -0
- package/templates/create/2d/scenes/boot.scene.js +12 -0
- package/templates/create/2d/scenes/gameplay.scene.js +230 -0
- package/templates/create/2d/scenes/menu.scene.js +9 -0
- package/templates/create/2d/src/main.js +6 -185
- package/templates/create/2d/src/runtime/app.js +49 -0
- package/templates/create/2d/src/runtime/capabilities.js +35 -0
- package/templates/create/2d/ui/hud.screen.js +40 -0
- package/templates/create/2d/ui/pause.screen.js +149 -0
- package/templates/create/2d/ui/settings.screen.js +347 -0
- package/templates/create/2d/ui/title.screen.js +13 -0
- package/templates/create/2d-adventure/aura.config.json +28 -0
- package/templates/create/2d-adventure/config/gameplay/adventure.config.js +14 -0
- package/templates/create/2d-adventure/content/gameplay/world.js +46 -0
- package/templates/create/2d-adventure/content/registries/.gitkeep +1 -0
- package/templates/create/2d-adventure/docs/design/loop.md +5 -0
- package/templates/create/2d-adventure/prefabs/player.prefab.js +54 -0
- package/templates/create/2d-adventure/prefabs/relic.prefab.js +38 -0
- package/templates/create/2d-adventure/prefabs/world.prefab.js +125 -0
- package/templates/create/2d-adventure/scenes/gameplay.scene.js +256 -0
- package/templates/create/2d-adventure/src/runtime/capabilities.js +34 -0
- package/templates/create/2d-adventure/ui/hud.screen.js +60 -0
- package/templates/create/2d-survivor/config/gameplay/survivor.config.js +33 -0
- package/templates/create/2d-survivor/content/gameplay/spawn-zones.json +29 -0
- package/templates/create/2d-survivor/content/registries/.gitkeep +1 -0
- package/templates/create/2d-survivor/docs/design/.gitkeep +1 -0
- package/templates/create/2d-survivor/docs/design/loop.md +5 -0
- package/templates/create/2d-survivor/prefabs/enemies.prefab.js +178 -0
- package/templates/create/2d-survivor/prefabs/enemy-swarm.prefab.js +18 -0
- package/templates/create/2d-survivor/prefabs/player.prefab.js +42 -0
- package/templates/create/2d-survivor/prefabs/projectiles.prefab.js +56 -0
- package/templates/create/2d-survivor/scenes/boot.scene.js +12 -0
- package/templates/create/2d-survivor/scenes/gameplay.scene.js +314 -0
- package/templates/create/2d-survivor/scenes/menu.scene.js +9 -0
- package/templates/create/2d-survivor/src/main.js +5 -332
- package/templates/create/2d-survivor/src/runtime/app.js +49 -0
- package/templates/create/2d-survivor/src/runtime/capabilities.js +35 -0
- package/templates/create/2d-survivor/ui/hud.screen.js +45 -0
- package/templates/create/2d-survivor/ui/title.screen.js +13 -0
- package/templates/create/3d/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d/config/gameplay/.gitkeep +1 -0
- package/templates/create/3d/content/gameplay/checkpoints.json +33 -0
- package/templates/create/3d/content/gameplay/course.js +40 -0
- package/templates/create/3d/content/registries/.gitkeep +1 -0
- package/templates/create/3d/docs/design/.gitkeep +1 -0
- package/templates/create/3d/docs/design/loop.md +5 -0
- package/templates/create/3d/prefabs/checkpoint.prefab.js +15 -0
- package/templates/create/3d/prefabs/player.prefab.js +204 -0
- package/templates/create/3d/prefabs/world.prefab.js +112 -0
- package/templates/create/3d/scenes/boot.scene.js +12 -0
- package/templates/create/3d/scenes/checkpoint.scene.js +9 -0
- package/templates/create/3d/scenes/gameplay.scene.js +292 -0
- package/templates/create/3d/src/main.js +6 -295
- package/templates/create/3d/src/runtime/app.js +49 -0
- package/templates/create/3d/src/runtime/capabilities.js +53 -0
- package/templates/create/3d/src/runtime/materials.js +34 -0
- package/templates/create/3d/src/runtime/state.js +39 -0
- package/templates/create/3d/ui/hud.screen.js +75 -0
- package/templates/create/3d/ui/pause.screen.js +166 -0
- package/templates/create/3d/ui/settings.screen.js +387 -0
- package/templates/create/3d-adventure/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d-adventure/aura.config.json +28 -0
- package/templates/create/3d-adventure/config/gameplay/adventure.config.js +9 -0
- package/templates/create/3d-adventure/content/gameplay/course.js +62 -0
- package/templates/create/3d-adventure/content/registries/.gitkeep +1 -0
- package/templates/create/3d-adventure/docs/design/loop.md +5 -0
- package/templates/create/3d-adventure/prefabs/player.prefab.js +168 -0
- package/templates/create/3d-adventure/prefabs/relic.prefab.js +35 -0
- package/templates/create/3d-adventure/prefabs/world.prefab.js +119 -0
- package/templates/create/3d-adventure/scenes/gameplay.scene.js +358 -0
- package/templates/create/3d-adventure/src/runtime/capabilities.js +56 -0
- package/templates/create/3d-adventure/src/runtime/materials.js +39 -0
- package/templates/create/3d-adventure/src/runtime/state.js +31 -0
- package/templates/create/3d-adventure/ui/hud.screen.js +70 -0
- package/templates/create/3d-adventure/ui/pause.screen.js +437 -0
- package/templates/create/3d-collectathon/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d-collectathon/config/gameplay/.gitkeep +1 -0
- package/templates/create/3d-collectathon/content/gameplay/collectibles.json +26 -0
- package/templates/create/3d-collectathon/content/gameplay/course.js +46 -0
- package/templates/create/3d-collectathon/content/registries/.gitkeep +1 -0
- package/templates/create/3d-collectathon/docs/design/.gitkeep +1 -0
- package/templates/create/3d-collectathon/docs/design/loop.md +5 -0
- package/templates/create/3d-collectathon/prefabs/collectible.prefab.js +15 -0
- package/templates/create/3d-collectathon/prefabs/player.prefab.js +207 -0
- package/templates/create/3d-collectathon/prefabs/world.prefab.js +112 -0
- package/templates/create/3d-collectathon/scenes/boot.scene.js +12 -0
- package/templates/create/3d-collectathon/scenes/checkpoint.scene.js +9 -0
- package/templates/create/3d-collectathon/scenes/gameplay.scene.js +200 -0
- package/templates/create/3d-collectathon/src/main.js +5 -355
- package/templates/create/3d-collectathon/src/runtime/app.js +49 -0
- package/templates/create/3d-collectathon/src/runtime/capabilities.js +53 -0
- package/templates/create/3d-collectathon/src/runtime/materials.js +34 -0
- package/templates/create/3d-collectathon/src/runtime/state.js +27 -0
- package/templates/create/3d-collectathon/ui/hud.screen.js +66 -0
- package/templates/create/3d-collectathon/ui/pause.screen.js +13 -0
- package/templates/create/blank/config/gameplay/.gitkeep +1 -0
- package/templates/create/blank/content/gameplay/.gitkeep +1 -0
- package/templates/create/blank/content/registries/.gitkeep +1 -0
- package/templates/create/blank/docs/design/.gitkeep +1 -0
- package/templates/create/blank/docs/design/loop.md +5 -0
- package/templates/create/blank/prefabs/.gitkeep +1 -0
- package/templates/create/blank/scenes/.gitkeep +1 -0
- package/templates/create/blank/src/runtime/.gitkeep +1 -0
- package/templates/create/blank/ui/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/audio/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/fonts/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/sprites/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/starter/README.md +11 -0
- package/templates/create/deckbuilder-2d/assets/ui/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/aura.config.json +28 -0
- package/templates/create/deckbuilder-2d/config/gameplay/deckbuilder.config.js +26 -0
- package/templates/create/deckbuilder-2d/content/cards/guard.card.js +19 -0
- package/templates/create/deckbuilder-2d/content/cards/spark.card.js +20 -0
- package/templates/create/deckbuilder-2d/content/cards/starter.deck.js +69 -0
- package/templates/create/deckbuilder-2d/content/cards/strike.card.js +19 -0
- package/templates/create/deckbuilder-2d/content/cards/survey.card.js +20 -0
- package/templates/create/deckbuilder-2d/content/encounters/training-battle.encounter.js +14 -0
- package/templates/create/deckbuilder-2d/content/encounters/training-battle.js +65 -0
- package/templates/create/deckbuilder-2d/content/enemies/training-automaton.enemy.js +48 -0
- package/templates/create/deckbuilder-2d/content/gameplay/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/content/registries/cards.registry.js +26 -0
- package/templates/create/deckbuilder-2d/content/registries/encounters.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/registries/enemies.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/registries/relics.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/relics/ember-charm.relic.js +18 -0
- package/templates/create/deckbuilder-2d/docs/design/loop.md +12 -0
- package/templates/create/deckbuilder-2d/prefabs/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/scenes/boot.scene.js +84 -0
- package/templates/create/deckbuilder-2d/scenes/gameplay.scene.js +641 -0
- package/templates/create/deckbuilder-2d/src/components/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/src/main.js +17 -0
- package/templates/create/deckbuilder-2d/src/runtime/capabilities.js +22 -0
- package/templates/create/deckbuilder-2d/src/shared/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/src/systems/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/tests/smoke/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/ui/hud.screen.js +80 -0
- package/templates/create/deckbuilder-2d/ui/pause.screen.js +146 -0
- package/templates/create/deckbuilder-2d/ui/settings.screen.js +342 -0
- package/templates/create/local-multiplayer/aura.config.json +40 -0
- package/templates/create/local-multiplayer/config/gameplay/local-multiplayer.config.js +26 -0
- package/templates/create/local-multiplayer/content/gameplay/room-layout.js +13 -0
- package/templates/create/local-multiplayer/content/registries/.gitkeep +1 -0
- package/templates/create/local-multiplayer/docs/design/loop.md +14 -0
- package/templates/create/local-multiplayer/prefabs/player.prefab.js +99 -0
- package/templates/create/local-multiplayer/scenes/boot.scene.js +12 -0
- package/templates/create/local-multiplayer/scenes/gameplay.scene.js +443 -0
- package/templates/create/local-multiplayer/src/main.js +17 -0
- package/templates/create/local-multiplayer/src/runtime/capabilities.js +28 -0
- package/templates/create/local-multiplayer/ui/hud.screen.js +60 -0
- package/templates/create/shared/src/runtime/project-inspector.js +105 -0
- package/templates/create/shared/src/runtime/scene-flow.js +290 -0
- package/templates/create/shared/src/runtime/screen-shell.js +222 -0
- package/templates/create/shared/src/runtime/ui-forms.js +209 -0
- package/templates/create/shared/src/runtime/ui-settings.js +237 -0
- package/templates/create/shared/src/runtime/ui-theme.js +352 -0
- package/templates/create/shared/src/starter-utils/adventure-objectives.js +102 -0
- package/templates/create/shared/src/starter-utils/animation-2d.js +337 -0
- package/templates/create/shared/src/starter-utils/avatar-3d.js +404 -0
- package/templates/create/shared/src/starter-utils/combat-feedback-2d.js +320 -0
- package/templates/create/shared/src/starter-utils/core.js +39 -3
- package/templates/create/shared/src/starter-utils/index.js +8 -2
- package/templates/create/shared/src/starter-utils/platformer-3d.js +34 -3
- package/templates/create/shared/src/starter-utils/triggers.js +662 -0
- package/templates/create/shared/src/starter-utils/tween-2d.js +615 -0
- package/templates/create/video-cutscene/assets/video/.gitkeep +0 -0
- package/templates/create/video-cutscene/aura.config.json +28 -0
- package/templates/create/video-cutscene/config/gameplay/.gitkeep +0 -0
- package/templates/create/video-cutscene/content/gameplay/.gitkeep +0 -0
- package/templates/create/video-cutscene/content/registries/.gitkeep +0 -0
- package/templates/create/video-cutscene/docs/design/loop.md +22 -0
- package/templates/create/video-cutscene/prefabs/.gitkeep +0 -0
- package/templates/create/video-cutscene/scenes/boot.scene.js +11 -0
- package/templates/create/video-cutscene/scenes/cutscene.scene.js +113 -0
- package/templates/create/video-cutscene/scenes/gameplay.scene.js +50 -0
- package/templates/create/video-cutscene/src/main.js +17 -0
- package/templates/create/video-cutscene/src/runtime/app.js +52 -0
- package/templates/create/video-cutscene/src/runtime/capabilities.js +35 -0
- package/templates/create/video-cutscene/src/runtime/state.js +13 -0
- package/templates/create/video-cutscene/ui/.gitkeep +0 -0
- package/templates/create-bin/play.js +1187 -0
- package/templates/make/README.md +46 -0
- package/templates/make/catalog.json +51 -0
- package/templates/make/component/files/{{MAKE_NAME}}.component.js +20 -0
- package/templates/make/component/manifest.json +9 -0
- package/templates/make/data/files/{{MAKE_NAME}}.json +14 -0
- package/templates/make/data/manifest.json +9 -0
- package/templates/make/material/files/{{MAKE_NAME}}.material.json +17 -0
- package/templates/make/material/manifest.json +9 -0
- package/templates/make/prefab/files/{{MAKE_NAME}}.prefab.js +20 -0
- package/templates/make/prefab/manifest.json +9 -0
- package/templates/make/scene/files/{{MAKE_NAME}}.scene.js +31 -0
- package/templates/make/scene/manifest.json +9 -0
- package/templates/make/shader/files/{{MAKE_NAME}}.shader.js +23 -0
- package/templates/make/shader/manifest.json +9 -0
- package/templates/make/system/files/{{MAKE_NAME}}.system.js +15 -0
- package/templates/make/system/manifest.json +9 -0
- package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.js +16 -0
- package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.json +23 -0
- package/templates/make/ui-screen/manifest.json +10 -0
- package/templates/make-starters/deckbuilder-2d/card/files/{{MAKE_NAME}}.card.js +22 -0
- package/templates/make-starters/deckbuilder-2d/card/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/catalog.json +34 -0
- package/templates/make-starters/deckbuilder-2d/encounter/files/{{MAKE_NAME}}.encounter.js +18 -0
- package/templates/make-starters/deckbuilder-2d/encounter/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/enemy/files/{{MAKE_NAME}}.enemy.js +28 -0
- package/templates/make-starters/deckbuilder-2d/enemy/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/relic/files/{{MAKE_NAME}}.relic.js +23 -0
- package/templates/make-starters/deckbuilder-2d/relic/manifest.json +9 -0
- package/templates/retro/platformer/README.md +10 -0
- package/templates/retro/platformer/assets/retro/assets.json +91 -0
- package/templates/retro/platformer/aura.config.json +7 -0
- package/templates/retro/platformer/package.json +5 -0
- package/templates/retro/platformer/src/main.js +40 -0
- package/templates/retro/puzzle-grid/README.md +10 -0
- package/templates/retro/puzzle-grid/assets/retro/assets.json +90 -0
- package/templates/retro/puzzle-grid/aura.config.json +7 -0
- package/templates/retro/puzzle-grid/package.json +5 -0
- package/templates/retro/puzzle-grid/src/main.js +29 -0
- package/templates/retro/tactics-grid/README.md +10 -0
- package/templates/retro/tactics-grid/assets/retro/assets.json +90 -0
- package/templates/retro/tactics-grid/aura.config.json +7 -0
- package/templates/retro/tactics-grid/package.json +5 -0
- package/templates/retro/tactics-grid/src/main.js +35 -0
- package/templates/retro/topdown-adventure/README.md +10 -0
- package/templates/retro/topdown-adventure/assets/retro/assets.json +95 -0
- package/templates/retro/topdown-adventure/aura.config.json +7 -0
- package/templates/retro/topdown-adventure/package.json +5 -0
- package/templates/retro/topdown-adventure/src/main.js +29 -0
- package/templates/skills/aurajs/SKILL.md +61 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function hasMethod(obj, method) {
|
|
2
|
+
return Boolean(obj) && typeof obj[method] === 'function';
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function failWithReason(reasonCode, message) {
|
|
6
|
+
throw new Error(`[2d-shooter-template] ${message} [reason:${reasonCode}]`);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function assertRuntimeCapabilities() {
|
|
10
|
+
const missing = [];
|
|
11
|
+
if (!hasMethod(aura.window, 'getSize')) missing.push('aura.window.getSize');
|
|
12
|
+
if (!hasMethod(aura.window, 'getFPS')) missing.push('aura.window.getFPS');
|
|
13
|
+
if (!hasMethod(aura.input, 'isKeyDown')) missing.push('aura.input.isKeyDown');
|
|
14
|
+
if (!hasMethod(aura.input, 'isKeyPressed')) missing.push('aura.input.isKeyPressed');
|
|
15
|
+
if (!hasMethod(aura.draw2d, 'clear')) missing.push('aura.draw2d.clear');
|
|
16
|
+
if (!hasMethod(aura.draw2d, 'rect')) missing.push('aura.draw2d.rect');
|
|
17
|
+
if (!hasMethod(aura.draw2d, 'text')) missing.push('aura.draw2d.text');
|
|
18
|
+
if (!hasMethod(aura.draw2d, 'measureText')) missing.push('aura.draw2d.measureText');
|
|
19
|
+
if (typeof aura.rgb !== 'function') missing.push('aura.rgb');
|
|
20
|
+
if (typeof aura.rgba !== 'function') missing.push('aura.rgba');
|
|
21
|
+
if (!aura.Color || !aura.Color.WHITE) missing.push('aura.Color.WHITE');
|
|
22
|
+
|
|
23
|
+
if (missing.length > 0) {
|
|
24
|
+
failWithReason('missing_runtime_api', `runtime missing required APIs: ${missing.join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const small = aura.draw2d.measureText('Probe', { size: 8 });
|
|
28
|
+
const large = aura.draw2d.measureText('Probe', { size: 24 });
|
|
29
|
+
if (!Number.isFinite(Number(small?.width)) || !Number.isFinite(Number(large?.width)) || Number(large.width) <= Number(small.width)) {
|
|
30
|
+
failWithReason(
|
|
31
|
+
'placeholder_runtime_behavior',
|
|
32
|
+
'draw2d.measureText appears to be placeholder behavior (size does not affect width).',
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SHOOTER_TEXT } from '../config/gameplay/shooter.config.js';
|
|
2
|
+
|
|
3
|
+
const hudScreen = {
|
|
4
|
+
id: 'hud',
|
|
5
|
+
kind: 'ui-screen',
|
|
6
|
+
notes: ['HUD draw helpers still live beside the authored screen descriptor in this template.'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function drawShooterHud({ waveDirector, score, lives, fps, gameOver, showControlsHint = true }) {
|
|
10
|
+
const waveLabel = waveDirector.completed ? SHOOTER_TEXT.waveDone : String(waveDirector.waveIndex + 1);
|
|
11
|
+
|
|
12
|
+
if (showControlsHint) {
|
|
13
|
+
aura.draw2d.text(SHOOTER_TEXT.controls, 12, 12, {
|
|
14
|
+
color: aura.Color.WHITE,
|
|
15
|
+
size: 15,
|
|
16
|
+
align: 'left',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
aura.draw2d.text(`Wave ${waveLabel} Score ${score} Lives ${lives} FPS ${fps}`, 12, showControlsHint ? 34 : 12, {
|
|
20
|
+
color: aura.Color.WHITE,
|
|
21
|
+
size: 14,
|
|
22
|
+
align: 'left',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
if (!gameOver) return;
|
|
26
|
+
|
|
27
|
+
const gameOverTop = showControlsHint ? 64 : 42;
|
|
28
|
+
aura.draw2d.text(SHOOTER_TEXT.gameOverTitle, 12, gameOverTop, {
|
|
29
|
+
color: aura.rgb(1.0, 0.42, 0.42),
|
|
30
|
+
size: 24,
|
|
31
|
+
align: 'left',
|
|
32
|
+
});
|
|
33
|
+
aura.draw2d.text(SHOOTER_TEXT.gameOverPrompt, 12, gameOverTop + 28, {
|
|
34
|
+
color: aura.Color.WHITE,
|
|
35
|
+
size: 16,
|
|
36
|
+
align: 'left',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default hudScreen;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { renderActionStrip } from '../src/runtime/ui-settings.js';
|
|
2
|
+
|
|
3
|
+
const pauseScreen = {
|
|
4
|
+
id: 'pause',
|
|
5
|
+
kind: 'ui-screen',
|
|
6
|
+
role: 'modal',
|
|
7
|
+
draw: drawPauseScreen,
|
|
8
|
+
notes: [
|
|
9
|
+
'Stage 154 adds a lightweight 2D pause/options modal without rewriting the shooter HUD.',
|
|
10
|
+
'Resume, restart, and settings now live in a retained authored screen mounted through screenShell.',
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function sizeOfWindow() {
|
|
15
|
+
return aura.window?.getSize?.() || { width: 1360, height: 820 };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function createPauseScreen() {
|
|
19
|
+
return pauseScreen;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function drawPauseScreen(data = {}, context = {}) {
|
|
23
|
+
const size = sizeOfWindow();
|
|
24
|
+
const panelWidth = Math.min(520, size.width - 72);
|
|
25
|
+
const panelHeight = Math.min(400, size.height - 88);
|
|
26
|
+
const panelX = Math.floor((size.width - panelWidth) * 0.5);
|
|
27
|
+
const panelY = Math.floor((size.height - panelHeight) * 0.5);
|
|
28
|
+
|
|
29
|
+
aura.draw2d.rect(0, 0, size.width, size.height, aura.rgba(0.02, 0.03, 0.06, 0.8));
|
|
30
|
+
|
|
31
|
+
aura.ui.beginView({
|
|
32
|
+
id: 'shooter-pause-root',
|
|
33
|
+
x: panelX,
|
|
34
|
+
y: panelY,
|
|
35
|
+
width: panelWidth,
|
|
36
|
+
height: panelHeight,
|
|
37
|
+
gap: 14,
|
|
38
|
+
padding: 18,
|
|
39
|
+
clip: true,
|
|
40
|
+
background: '#08111b',
|
|
41
|
+
borderColor: '#32506c',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
aura.ui.text('shooter-pause-eyebrow', {
|
|
45
|
+
text: 'PAUSE MENU',
|
|
46
|
+
size: 12,
|
|
47
|
+
color: '#86c1f5',
|
|
48
|
+
});
|
|
49
|
+
aura.ui.text('shooter-pause-title', {
|
|
50
|
+
text: 'Arcade run paused',
|
|
51
|
+
size: 28,
|
|
52
|
+
color: '#f4f8ff',
|
|
53
|
+
});
|
|
54
|
+
aura.ui.text('shooter-pause-copy', {
|
|
55
|
+
text: 'The starter HUD stays manual in 154, but pause and settings now mount through screenShell and shared UI preferences.',
|
|
56
|
+
size: 14,
|
|
57
|
+
color: '#c9d9ea',
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
aura.ui.beginRow({
|
|
61
|
+
id: 'shooter-pause-shell',
|
|
62
|
+
gap: 16,
|
|
63
|
+
width: 'fill',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
aura.ui.beginColumn({
|
|
67
|
+
id: 'shooter-pause-summary',
|
|
68
|
+
width: 210,
|
|
69
|
+
gap: 10,
|
|
70
|
+
padding: 14,
|
|
71
|
+
background: '#0d1826',
|
|
72
|
+
borderColor: '#21384d',
|
|
73
|
+
});
|
|
74
|
+
aura.ui.text('shooter-pause-summary-label', {
|
|
75
|
+
text: 'RUN SNAPSHOT',
|
|
76
|
+
size: 11,
|
|
77
|
+
color: '#7fb7ea',
|
|
78
|
+
});
|
|
79
|
+
aura.ui.text('shooter-pause-score', {
|
|
80
|
+
text: `Score ${data.score ?? 0}`,
|
|
81
|
+
size: 18,
|
|
82
|
+
color: '#eef5ff',
|
|
83
|
+
});
|
|
84
|
+
aura.ui.text('shooter-pause-lives', {
|
|
85
|
+
text: `Lives ${data.lives ?? 0}`,
|
|
86
|
+
size: 14,
|
|
87
|
+
color: '#d1dfef',
|
|
88
|
+
});
|
|
89
|
+
aura.ui.text('shooter-pause-high-score', {
|
|
90
|
+
text: `Best ${data.highScore ?? 0}`,
|
|
91
|
+
size: 14,
|
|
92
|
+
color: '#d1dfef',
|
|
93
|
+
});
|
|
94
|
+
aura.ui.text('shooter-pause-wave', {
|
|
95
|
+
text: `Wave ${data.wave ?? 1}`,
|
|
96
|
+
size: 13,
|
|
97
|
+
color: '#f0cf79',
|
|
98
|
+
});
|
|
99
|
+
aura.ui.endColumn();
|
|
100
|
+
|
|
101
|
+
aura.ui.beginColumn({
|
|
102
|
+
id: 'shooter-pause-actions-col',
|
|
103
|
+
width: 'fill',
|
|
104
|
+
gap: 12,
|
|
105
|
+
padding: 14,
|
|
106
|
+
background: '#0d1826',
|
|
107
|
+
borderColor: '#21384d',
|
|
108
|
+
});
|
|
109
|
+
aura.ui.text('shooter-pause-actions-label', {
|
|
110
|
+
text: 'QUICK ACTIONS',
|
|
111
|
+
size: 11,
|
|
112
|
+
color: '#7fb7ea',
|
|
113
|
+
});
|
|
114
|
+
aura.ui.text('shooter-pause-actions-copy', {
|
|
115
|
+
text: 'Use settings to edit the shared appState.ui preference slice without leaving the run.',
|
|
116
|
+
size: 13,
|
|
117
|
+
color: '#d1dfef',
|
|
118
|
+
});
|
|
119
|
+
const actions = renderActionStrip({
|
|
120
|
+
id: 'shooter-pause-actions',
|
|
121
|
+
actions: [
|
|
122
|
+
{ id: 'resume', label: 'Resume' },
|
|
123
|
+
{ id: 'settings', label: 'Settings' },
|
|
124
|
+
{ id: 'restart', label: 'Restart Run' },
|
|
125
|
+
],
|
|
126
|
+
});
|
|
127
|
+
aura.ui.text('shooter-pause-note', {
|
|
128
|
+
text: 'Esc closes the top modal. The gameplay HUD remains intentionally manual in this starter.',
|
|
129
|
+
size: 12,
|
|
130
|
+
color: '#9db2cb',
|
|
131
|
+
});
|
|
132
|
+
aura.ui.endColumn();
|
|
133
|
+
|
|
134
|
+
aura.ui.endRow();
|
|
135
|
+
aura.ui.endView();
|
|
136
|
+
|
|
137
|
+
if (actions.actionId === 'resume') {
|
|
138
|
+
context.popModalScreen?.({ action: 'resume' });
|
|
139
|
+
} else if (actions.actionId === 'settings') {
|
|
140
|
+
context.pushModalScreen?.('settings', {
|
|
141
|
+
source: 'pause',
|
|
142
|
+
});
|
|
143
|
+
} else if (actions.actionId === 'restart') {
|
|
144
|
+
context.popModalScreen?.({ action: 'restart' });
|
|
145
|
+
context.replaceScene?.('gameplay');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export default pauseScreen;
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureUiPreferences,
|
|
3
|
+
inspectUiTheme,
|
|
4
|
+
resetUiPreferences,
|
|
5
|
+
updateUiPreferences,
|
|
6
|
+
} from '../src/runtime/ui-theme.js';
|
|
7
|
+
import {
|
|
8
|
+
formatPercentFromTenth,
|
|
9
|
+
listContrastSegmentOptions,
|
|
10
|
+
listDensitySegmentOptions,
|
|
11
|
+
listThemeSegmentOptions,
|
|
12
|
+
readBooleanViewValue,
|
|
13
|
+
readNumberViewValue,
|
|
14
|
+
renderActionStrip,
|
|
15
|
+
renderSegmentedControl,
|
|
16
|
+
} from '../src/runtime/ui-settings.js';
|
|
17
|
+
|
|
18
|
+
const settingsScreen = {
|
|
19
|
+
id: 'settings',
|
|
20
|
+
kind: 'ui-screen',
|
|
21
|
+
role: 'modal',
|
|
22
|
+
draw: drawSettingsScreen,
|
|
23
|
+
notes: [
|
|
24
|
+
'Stage 154 gives the 2D shooter one retained settings/options modal backed by appState.ui.preferences.',
|
|
25
|
+
'The HUD remains manual, but theme and settings now have one obvious scaffolded seam.',
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function sizeOfWindow() {
|
|
30
|
+
return aura.window?.getSize?.() || { width: 1360, height: 820 };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ensureSettingsView(context, appState) {
|
|
34
|
+
if (typeof context.ensureUiState === 'function') {
|
|
35
|
+
return context.ensureUiState('settingsView', {
|
|
36
|
+
activeSection: 'audio',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (!appState.ui || typeof appState.ui !== 'object' || Array.isArray(appState.ui)) {
|
|
40
|
+
appState.ui = {};
|
|
41
|
+
}
|
|
42
|
+
if (!appState.ui.settingsView || typeof appState.ui.settingsView !== 'object' || Array.isArray(appState.ui.settingsView)) {
|
|
43
|
+
appState.ui.settingsView = {
|
|
44
|
+
activeSection: 'audio',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return appState.ui.settingsView;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function ensureShooterUiState(context, appState) {
|
|
51
|
+
if (typeof context.ensureUiState === 'function') {
|
|
52
|
+
return context.ensureUiState('shooterHud', {
|
|
53
|
+
showControlsHint: true,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!appState.ui || typeof appState.ui !== 'object' || Array.isArray(appState.ui)) {
|
|
57
|
+
appState.ui = {};
|
|
58
|
+
}
|
|
59
|
+
if (!appState.ui.shooterHud || typeof appState.ui.shooterHud !== 'object' || Array.isArray(appState.ui.shooterHud)) {
|
|
60
|
+
appState.ui.shooterHud = {
|
|
61
|
+
showControlsHint: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return appState.ui.shooterHud;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function currentPreferences(context, appState) {
|
|
68
|
+
if (typeof context.getUiPreferences === 'function') {
|
|
69
|
+
return context.getUiPreferences();
|
|
70
|
+
}
|
|
71
|
+
return ensureUiPreferences(appState);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function currentThemeState(context, appState) {
|
|
75
|
+
if (typeof context.getUiThemeState === 'function') {
|
|
76
|
+
return context.getUiThemeState();
|
|
77
|
+
}
|
|
78
|
+
return inspectUiTheme(appState);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function updatePreferences(context, appState, patch) {
|
|
82
|
+
if (typeof context.updateUiPreferences === 'function') {
|
|
83
|
+
return context.updateUiPreferences(patch);
|
|
84
|
+
}
|
|
85
|
+
return updateUiPreferences(appState, patch);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resetPreferences(context, appState) {
|
|
89
|
+
if (typeof context.resetUiPreferences === 'function') {
|
|
90
|
+
return context.resetUiPreferences();
|
|
91
|
+
}
|
|
92
|
+
return resetUiPreferences(appState);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function clickedSegmentOption(controlId, optionId) {
|
|
96
|
+
const state = aura.ui.getViewState(`${controlId}-${optionId}`);
|
|
97
|
+
return state?.clicked === true || state?.activated === true;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function createSettingsScreen() {
|
|
101
|
+
return settingsScreen;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function drawSettingsScreen(_data = {}, context = {}) {
|
|
105
|
+
const appState = context.appState || {};
|
|
106
|
+
const settingsView = ensureSettingsView(context, appState);
|
|
107
|
+
const shooterUiState = ensureShooterUiState(context, appState);
|
|
108
|
+
const preferences = currentPreferences(context, appState);
|
|
109
|
+
const themeState = currentThemeState(context, appState);
|
|
110
|
+
const size = sizeOfWindow();
|
|
111
|
+
const panelWidth = Math.min(940, size.width - 72);
|
|
112
|
+
const panelHeight = Math.min(620, size.height - 88);
|
|
113
|
+
const panelX = Math.floor((size.width - panelWidth) * 0.5);
|
|
114
|
+
const panelY = Math.floor((size.height - panelHeight) * 0.5);
|
|
115
|
+
|
|
116
|
+
aura.draw2d.rect(0, 0, size.width, size.height, aura.rgba(0.02, 0.03, 0.06, 0.82));
|
|
117
|
+
|
|
118
|
+
aura.ui.beginView({
|
|
119
|
+
id: 'shooter-settings-root',
|
|
120
|
+
x: panelX,
|
|
121
|
+
y: panelY,
|
|
122
|
+
width: panelWidth,
|
|
123
|
+
height: panelHeight,
|
|
124
|
+
gap: 14,
|
|
125
|
+
padding: 18,
|
|
126
|
+
clip: true,
|
|
127
|
+
background: '#08111b',
|
|
128
|
+
borderColor: '#32506c',
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
aura.ui.text('shooter-settings-eyebrow', {
|
|
132
|
+
text: 'SETTINGS',
|
|
133
|
+
size: 12,
|
|
134
|
+
color: '#86c1f5',
|
|
135
|
+
});
|
|
136
|
+
aura.ui.text('shooter-settings-title', {
|
|
137
|
+
text: 'Shared UI preferences',
|
|
138
|
+
size: 28,
|
|
139
|
+
color: '#f4f8ff',
|
|
140
|
+
});
|
|
141
|
+
aura.ui.text('shooter-settings-copy', {
|
|
142
|
+
text: 'This starter keeps its HUD manual, but the options flow now uses a retained authored modal and a single appState.ui.preferences seam.',
|
|
143
|
+
size: 14,
|
|
144
|
+
color: '#c9d9ea',
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
aura.ui.beginRow({
|
|
148
|
+
id: 'shooter-settings-shell',
|
|
149
|
+
gap: 16,
|
|
150
|
+
width: 'fill',
|
|
151
|
+
height: 'fill',
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
aura.ui.beginColumn({
|
|
155
|
+
id: 'shooter-settings-summary',
|
|
156
|
+
width: 250,
|
|
157
|
+
gap: 10,
|
|
158
|
+
padding: 14,
|
|
159
|
+
background: '#0d1826',
|
|
160
|
+
borderColor: '#21384d',
|
|
161
|
+
});
|
|
162
|
+
aura.ui.text('shooter-settings-summary-label', {
|
|
163
|
+
text: 'LIVE SNAPSHOT',
|
|
164
|
+
size: 11,
|
|
165
|
+
color: '#7fb7ea',
|
|
166
|
+
});
|
|
167
|
+
aura.ui.text('shooter-settings-summary-theme', {
|
|
168
|
+
text: `Theme ${themeState?.presetLabel || 'Signal Dawn'}`,
|
|
169
|
+
size: 15,
|
|
170
|
+
color: '#eef5ff',
|
|
171
|
+
});
|
|
172
|
+
aura.ui.text('shooter-settings-summary-density', {
|
|
173
|
+
text: `Density ${themeState?.density === 'compact' ? 'Compact' : 'Cozy'}`,
|
|
174
|
+
size: 15,
|
|
175
|
+
color: '#eef5ff',
|
|
176
|
+
});
|
|
177
|
+
aura.ui.text('shooter-settings-summary-audio', {
|
|
178
|
+
text: `Music ${preferences.musicEnabled ? 'On' : 'Off'} · Volume ${formatPercentFromTenth(preferences.masterVolume)}`,
|
|
179
|
+
size: 14,
|
|
180
|
+
color: '#d1dfef',
|
|
181
|
+
});
|
|
182
|
+
aura.ui.text('shooter-settings-summary-interface', {
|
|
183
|
+
text: `Hints ${shooterUiState.showControlsHint !== false ? 'Shown' : 'Hidden'} · Subtitles ${preferences.subtitlesEnabled ? 'On' : 'Off'}`,
|
|
184
|
+
size: 14,
|
|
185
|
+
color: '#d1dfef',
|
|
186
|
+
});
|
|
187
|
+
aura.ui.text('shooter-settings-summary-note', {
|
|
188
|
+
text: 'The settings section id is shared in appState.ui.settingsView while focus remains runtime-owned inside aura.ui.',
|
|
189
|
+
size: 12,
|
|
190
|
+
color: '#9db2cb',
|
|
191
|
+
});
|
|
192
|
+
aura.ui.endColumn();
|
|
193
|
+
|
|
194
|
+
aura.ui.beginColumn({
|
|
195
|
+
id: 'shooter-settings-main',
|
|
196
|
+
width: 'fill',
|
|
197
|
+
gap: 12,
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
const sectionTabs = renderSegmentedControl({
|
|
201
|
+
id: 'shooter-settings-sections',
|
|
202
|
+
label: 'Section',
|
|
203
|
+
value: settingsView.activeSection || 'audio',
|
|
204
|
+
options: [
|
|
205
|
+
{ id: 'audio', label: 'Audio' },
|
|
206
|
+
{ id: 'display', label: 'Display' },
|
|
207
|
+
{ id: 'interface', label: 'Interface' },
|
|
208
|
+
],
|
|
209
|
+
});
|
|
210
|
+
if (sectionTabs.changed) {
|
|
211
|
+
settingsView.activeSection = sectionTabs.value;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
aura.ui.beginColumn({
|
|
215
|
+
id: 'shooter-settings-card',
|
|
216
|
+
gap: 12,
|
|
217
|
+
width: 'fill',
|
|
218
|
+
padding: 14,
|
|
219
|
+
background: '#0d1826',
|
|
220
|
+
borderColor: '#21384d',
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
if ((settingsView.activeSection || 'audio') === 'audio') {
|
|
224
|
+
aura.ui.text('shooter-settings-audio-label', {
|
|
225
|
+
text: 'AUDIO',
|
|
226
|
+
size: 11,
|
|
227
|
+
color: '#7fb7ea',
|
|
228
|
+
});
|
|
229
|
+
aura.ui.toggle('shooter-settings-music', {
|
|
230
|
+
label: 'Music playback',
|
|
231
|
+
value: preferences.musicEnabled === true,
|
|
232
|
+
width: 'fill',
|
|
233
|
+
});
|
|
234
|
+
aura.ui.slider('shooter-settings-volume', {
|
|
235
|
+
label: `Master volume ${formatPercentFromTenth(preferences.masterVolume)}`,
|
|
236
|
+
min: 0,
|
|
237
|
+
max: 10,
|
|
238
|
+
step: 1,
|
|
239
|
+
value: preferences.masterVolume,
|
|
240
|
+
width: 'fill',
|
|
241
|
+
});
|
|
242
|
+
} else if (settingsView.activeSection === 'display') {
|
|
243
|
+
aura.ui.text('shooter-settings-display-label', {
|
|
244
|
+
text: 'DISPLAY',
|
|
245
|
+
size: 11,
|
|
246
|
+
color: '#7fb7ea',
|
|
247
|
+
});
|
|
248
|
+
renderSegmentedControl({
|
|
249
|
+
id: 'shooter-settings-theme',
|
|
250
|
+
label: 'Theme preset',
|
|
251
|
+
description: 'Starter-owned semantic presets from src/runtime/ui-theme.js.',
|
|
252
|
+
value: preferences.themeId,
|
|
253
|
+
options: listThemeSegmentOptions(),
|
|
254
|
+
});
|
|
255
|
+
renderSegmentedControl({
|
|
256
|
+
id: 'shooter-settings-density',
|
|
257
|
+
label: 'Density',
|
|
258
|
+
value: preferences.density,
|
|
259
|
+
options: listDensitySegmentOptions(),
|
|
260
|
+
});
|
|
261
|
+
renderSegmentedControl({
|
|
262
|
+
id: 'shooter-settings-contrast',
|
|
263
|
+
label: 'Contrast',
|
|
264
|
+
value: preferences.contrast,
|
|
265
|
+
options: listContrastSegmentOptions(),
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
aura.ui.text('shooter-settings-interface-label', {
|
|
269
|
+
text: 'INTERFACE',
|
|
270
|
+
size: 11,
|
|
271
|
+
color: '#7fb7ea',
|
|
272
|
+
});
|
|
273
|
+
aura.ui.toggle('shooter-settings-subtitles', {
|
|
274
|
+
label: 'Subtitles',
|
|
275
|
+
value: preferences.subtitlesEnabled === true,
|
|
276
|
+
width: 'fill',
|
|
277
|
+
});
|
|
278
|
+
aura.ui.toggle('shooter-settings-reduce-motion', {
|
|
279
|
+
label: 'Reduce motion',
|
|
280
|
+
value: preferences.reduceMotion === true,
|
|
281
|
+
width: 'fill',
|
|
282
|
+
});
|
|
283
|
+
aura.ui.toggle('shooter-settings-controls-hint', {
|
|
284
|
+
label: 'Show controls hint on restart',
|
|
285
|
+
value: shooterUiState.showControlsHint !== false,
|
|
286
|
+
width: 'fill',
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
aura.ui.endColumn();
|
|
291
|
+
|
|
292
|
+
const actions = renderActionStrip({
|
|
293
|
+
id: 'shooter-settings-actions',
|
|
294
|
+
actions: [
|
|
295
|
+
{ id: 'restore', label: 'Restore Defaults' },
|
|
296
|
+
{ id: 'back', label: 'Back' },
|
|
297
|
+
],
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
aura.ui.endColumn();
|
|
301
|
+
aura.ui.endRow();
|
|
302
|
+
aura.ui.endView();
|
|
303
|
+
|
|
304
|
+
const patch = {};
|
|
305
|
+
const musicEnabled = readBooleanViewValue('shooter-settings-music', preferences.musicEnabled);
|
|
306
|
+
const masterVolume = readNumberViewValue('shooter-settings-volume', preferences.masterVolume);
|
|
307
|
+
const subtitlesEnabled = readBooleanViewValue('shooter-settings-subtitles', preferences.subtitlesEnabled);
|
|
308
|
+
const reduceMotion = readBooleanViewValue('shooter-settings-reduce-motion', preferences.reduceMotion);
|
|
309
|
+
const controlsHint = readBooleanViewValue('shooter-settings-controls-hint', shooterUiState.showControlsHint !== false);
|
|
310
|
+
|
|
311
|
+
if (musicEnabled !== preferences.musicEnabled) patch.musicEnabled = musicEnabled;
|
|
312
|
+
if (masterVolume !== preferences.masterVolume) patch.masterVolume = masterVolume;
|
|
313
|
+
if (subtitlesEnabled !== preferences.subtitlesEnabled) patch.subtitlesEnabled = subtitlesEnabled;
|
|
314
|
+
if (reduceMotion !== preferences.reduceMotion) patch.reduceMotion = reduceMotion;
|
|
315
|
+
|
|
316
|
+
for (const option of listThemeSegmentOptions()) {
|
|
317
|
+
if (clickedSegmentOption('shooter-settings-theme', option.id)) {
|
|
318
|
+
patch.themeId = option.id;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
for (const option of listDensitySegmentOptions()) {
|
|
322
|
+
if (clickedSegmentOption('shooter-settings-density', option.id)) {
|
|
323
|
+
patch.density = option.id;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
for (const option of listContrastSegmentOptions()) {
|
|
327
|
+
if (clickedSegmentOption('shooter-settings-contrast', option.id)) {
|
|
328
|
+
patch.contrast = option.id;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (controlsHint !== (shooterUiState.showControlsHint !== false)) {
|
|
333
|
+
shooterUiState.showControlsHint = controlsHint;
|
|
334
|
+
}
|
|
335
|
+
if (Object.keys(patch).length > 0) {
|
|
336
|
+
updatePreferences(context, appState, patch);
|
|
337
|
+
}
|
|
338
|
+
if (actions.actionId === 'restore') {
|
|
339
|
+
resetPreferences(context, appState);
|
|
340
|
+
shooterUiState.showControlsHint = true;
|
|
341
|
+
settingsView.activeSection = 'audio';
|
|
342
|
+
} else if (actions.actionId === 'back') {
|
|
343
|
+
context.popModalScreen?.({ action: 'back' });
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export default settingsScreen;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "{{PROJECT_TITLE}}",
|
|
4
|
+
"version": "{{PROJECT_VERSION}}",
|
|
5
|
+
"executable": "{{PROJECT_BIN_NAME}}",
|
|
6
|
+
"icon": null
|
|
7
|
+
},
|
|
8
|
+
"window": {
|
|
9
|
+
"title": "{{PROJECT_TITLE}}",
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720,
|
|
12
|
+
"resizable": true,
|
|
13
|
+
"fullscreen": false,
|
|
14
|
+
"vsync": true,
|
|
15
|
+
"hidpi": true
|
|
16
|
+
},
|
|
17
|
+
"build": {
|
|
18
|
+
"entry": "src/main.js",
|
|
19
|
+
"outDir": "build",
|
|
20
|
+
"assetDir": "assets",
|
|
21
|
+
"assetMode": "embed"
|
|
22
|
+
},
|
|
23
|
+
"modules": {
|
|
24
|
+
"physics": false,
|
|
25
|
+
"network": true,
|
|
26
|
+
"steam": false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const ADVENTURE_CONFIG = {
|
|
2
|
+
playerSize: 28,
|
|
3
|
+
playerSpeed: 232,
|
|
4
|
+
relicRadius: 20,
|
|
5
|
+
beaconRadius: 42,
|
|
6
|
+
exitPadding: 18,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const ADVENTURE_TEXT = {
|
|
10
|
+
started: '{{PROJECT_TITLE}} started (2D adventure template)',
|
|
11
|
+
controls: 'Move: Arrows/WASD Interact: E or Enter Hint: H',
|
|
12
|
+
clearedTitle: 'RUINS SURVEY COMPLETE',
|
|
13
|
+
clearedPrompt: 'Press Enter to restart the route',
|
|
14
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const WORLD_BOUNDS = { x: 72, y: 72, width: 1136, height: 576 };
|
|
2
|
+
|
|
3
|
+
export const PLAYER_SPAWN = { x: 156, y: 584 };
|
|
4
|
+
|
|
5
|
+
export const WORLD_OBSTACLES = [
|
|
6
|
+
{ id: 'fallen-arch', x: 312, y: 236, w: 220, h: 40 },
|
|
7
|
+
{ id: 'mirror-pool', x: 694, y: 172, w: 164, h: 104 },
|
|
8
|
+
{ id: 'collapsed-hall', x: 530, y: 422, w: 268, h: 42 },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const RELIC_SPAWNS = [
|
|
12
|
+
{ id: 'survey-lens', label: 'Survey Lens', x: 214, y: 190, radius: 20 },
|
|
13
|
+
{ id: 'signal-reel', label: 'Signal Reel', x: 546, y: 152, radius: 20 },
|
|
14
|
+
{ id: 'chorus-map', label: 'Chorus Map', x: 930, y: 352, radius: 20 },
|
|
15
|
+
{ id: 'dawn-key', label: 'Dawn Key', x: 792, y: 548, radius: 20 },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export const BEACON_SITES = [
|
|
19
|
+
{
|
|
20
|
+
id: 'north-brazier',
|
|
21
|
+
label: 'North Brazier',
|
|
22
|
+
x: 246,
|
|
23
|
+
y: 150,
|
|
24
|
+
size: 34,
|
|
25
|
+
radius: 42,
|
|
26
|
+
requiredRelics: 1,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'east-brazier',
|
|
30
|
+
label: 'East Brazier',
|
|
31
|
+
x: 1034,
|
|
32
|
+
y: 276,
|
|
33
|
+
size: 34,
|
|
34
|
+
radius: 42,
|
|
35
|
+
requiredRelics: 3,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export const EXIT_GATE = {
|
|
40
|
+
id: 'moon-gate',
|
|
41
|
+
label: 'Moon Gate',
|
|
42
|
+
x: 1028,
|
|
43
|
+
y: 526,
|
|
44
|
+
w: 118,
|
|
45
|
+
h: 88,
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# 2D Adventure Loop
|
|
2
|
+
|
|
3
|
+
1. Sweep the ruin, collect four relics, and light the route beacons.
|
|
4
|
+
1. Keep tuning knobs in `config/gameplay/adventure.config.js` and authored room nouns in `content/gameplay/world.js`.
|
|
5
|
+
1. Extend the loop by adding more relic families, gate rules, or room variants before introducing heavier systems.
|