@auraindustry/aurajs 0.0.7 → 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 +98 -2
- 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,53 @@
|
|
|
1
|
+
function hasMethod(obj, method) {
|
|
2
|
+
return Boolean(obj) && typeof obj[method] === 'function';
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function failWithReason(reasonCode, message) {
|
|
6
|
+
throw new Error(`[3d-platformer-template] ${message} [reason:${reasonCode}]`);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function assertRuntimeCapabilities() {
|
|
10
|
+
const missing = [];
|
|
11
|
+
if (!hasMethod(aura.mesh, 'createBox')) missing.push('aura.mesh.createBox');
|
|
12
|
+
if (!hasMethod(aura.material, 'create')) missing.push('aura.material.create');
|
|
13
|
+
if (!hasMethod(aura.light, 'ambient')) missing.push('aura.light.ambient');
|
|
14
|
+
if (!hasMethod(aura.light, 'directional')) missing.push('aura.light.directional');
|
|
15
|
+
if (!hasMethod(aura.camera3d, 'perspective')) missing.push('aura.camera3d.perspective');
|
|
16
|
+
if (!hasMethod(aura.camera3d, 'setPosition')) missing.push('aura.camera3d.setPosition');
|
|
17
|
+
if (!hasMethod(aura.camera3d, 'lookAt')) missing.push('aura.camera3d.lookAt');
|
|
18
|
+
if (!hasMethod(aura.character3d, 'create')) missing.push('aura.character3d.create');
|
|
19
|
+
if (!hasMethod(aura.character3d, 'move')) missing.push('aura.character3d.move');
|
|
20
|
+
if (!hasMethod(aura.character3d, 'jump')) missing.push('aura.character3d.jump');
|
|
21
|
+
if (!hasMethod(aura.character3d, 'update')) missing.push('aura.character3d.update');
|
|
22
|
+
if (!hasMethod(aura.character3d, 'getState')) missing.push('aura.character3d.getState');
|
|
23
|
+
if (!hasMethod(aura.character3d, 'setPosition')) missing.push('aura.character3d.setPosition');
|
|
24
|
+
if (!hasMethod(aura.character3d, 'addObstacle')) missing.push('aura.character3d.addObstacle');
|
|
25
|
+
if (!hasMethod(aura.character3d, 'clearObstacles')) missing.push('aura.character3d.clearObstacles');
|
|
26
|
+
if (!hasMethod(aura.input, 'isKeyDown')) missing.push('aura.input.isKeyDown');
|
|
27
|
+
if (!hasMethod(aura.input, 'isKeyPressed')) missing.push('aura.input.isKeyPressed');
|
|
28
|
+
if (!hasMethod(aura.scene3d, 'loadGltfScene')) missing.push('aura.scene3d.loadGltfScene');
|
|
29
|
+
if (!hasMethod(aura.scene3d, 'getImportedScene')) missing.push('aura.scene3d.getImportedScene');
|
|
30
|
+
if (!hasMethod(aura.scene3d, 'playImportedAnimation')) missing.push('aura.scene3d.playImportedAnimation');
|
|
31
|
+
if (!hasMethod(aura.scene3d, 'setLocalTransform')) missing.push('aura.scene3d.setLocalTransform');
|
|
32
|
+
if (!hasMethod(aura.scene3d, 'updateClips')) missing.push('aura.scene3d.updateClips');
|
|
33
|
+
if (!hasMethod(aura.scene3d, 'submitRenderBindings')) missing.push('aura.scene3d.submitRenderBindings');
|
|
34
|
+
if (!hasMethod(aura.draw3d, 'clear3d')) missing.push('aura.draw3d.clear3d');
|
|
35
|
+
if (!hasMethod(aura.draw3d, 'drawMesh')) missing.push('aura.draw3d.drawMesh');
|
|
36
|
+
if (!hasMethod(aura.draw2d, 'text')) missing.push('aura.draw2d.text');
|
|
37
|
+
if (!hasMethod(aura.draw2d, 'measureText')) missing.push('aura.draw2d.measureText');
|
|
38
|
+
if (typeof aura.rgb !== 'function') missing.push('aura.rgb');
|
|
39
|
+
if (!aura.Color || !aura.Color.WHITE) missing.push('aura.Color.WHITE');
|
|
40
|
+
|
|
41
|
+
if (missing.length > 0) {
|
|
42
|
+
failWithReason('missing_runtime_api', `runtime missing required APIs: ${missing.join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const small = aura.draw2d.measureText('Probe', { size: 8 });
|
|
46
|
+
const large = aura.draw2d.measureText('Probe', { size: 24 });
|
|
47
|
+
if (!Number.isFinite(Number(small?.width)) || !Number.isFinite(Number(large?.width)) || Number(large.width) <= Number(small.width)) {
|
|
48
|
+
failWithReason(
|
|
49
|
+
'placeholder_runtime_behavior',
|
|
50
|
+
'draw2d.measureText appears to be placeholder behavior (size does not affect width).',
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function createPlatformerMaterials() {
|
|
2
|
+
return {
|
|
3
|
+
floor: aura.material.create({
|
|
4
|
+
color: { r: 0.18, g: 0.28, b: 0.2, a: 1.0 },
|
|
5
|
+
metallic: 0.05,
|
|
6
|
+
roughness: 0.95,
|
|
7
|
+
}),
|
|
8
|
+
platform: aura.material.create({
|
|
9
|
+
color: { r: 0.42, g: 0.56, b: 0.78, a: 1.0 },
|
|
10
|
+
metallic: 0.1,
|
|
11
|
+
roughness: 0.6,
|
|
12
|
+
}),
|
|
13
|
+
player: aura.material.create({
|
|
14
|
+
color: { r: 0.98, g: 0.52, b: 0.26, a: 1.0 },
|
|
15
|
+
metallic: 0.25,
|
|
16
|
+
roughness: 0.35,
|
|
17
|
+
}),
|
|
18
|
+
pickup: aura.material.create({
|
|
19
|
+
color: { r: 0.95, g: 0.9, b: 0.3, a: 1.0 },
|
|
20
|
+
metallic: 0.65,
|
|
21
|
+
roughness: 0.25,
|
|
22
|
+
}),
|
|
23
|
+
checkpoint: aura.material.create({
|
|
24
|
+
color: { r: 0.36, g: 0.9, b: 1.0, a: 1.0 },
|
|
25
|
+
metallic: 0.45,
|
|
26
|
+
roughness: 0.28,
|
|
27
|
+
}),
|
|
28
|
+
goal: aura.material.create({
|
|
29
|
+
color: { r: 0.5, g: 1.0, b: 0.64, a: 1.0 },
|
|
30
|
+
metallic: 0.35,
|
|
31
|
+
roughness: 0.35,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createCheckpointSystem, createMovingPlatform3D } from '../starter-utils/index.js';
|
|
2
|
+
import { CHECKPOINTS, MOVING_PLATFORM, PICKUP_RESPAWNS, PICKUP_START, PLAYER_SPAWN } from '../../content/gameplay/course.js';
|
|
3
|
+
import { createPlayerAvatar, resetPlayerAvatar } from '../../prefabs/player.prefab.js';
|
|
4
|
+
|
|
5
|
+
function clonePosition(entry) {
|
|
6
|
+
return {
|
|
7
|
+
x: entry.x,
|
|
8
|
+
y: entry.y,
|
|
9
|
+
z: entry.z,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createPlatformerRunState(existingPlayer = null) {
|
|
14
|
+
return {
|
|
15
|
+
player: existingPlayer ? resetPlayerAvatar(existingPlayer, PLAYER_SPAWN) : createPlayerAvatar(PLAYER_SPAWN),
|
|
16
|
+
pickup: clonePosition(PICKUP_START),
|
|
17
|
+
score: 0,
|
|
18
|
+
elapsed: 0,
|
|
19
|
+
levelComplete: false,
|
|
20
|
+
checkpointSystem: createCheckpointSystem({ checkpoints: CHECKPOINTS }),
|
|
21
|
+
movingPlatform: createMovingPlatform3D(MOVING_PLATFORM),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function advancePickupState(state) {
|
|
26
|
+
state.score += 1;
|
|
27
|
+
|
|
28
|
+
if (state.score % 3 === 0) {
|
|
29
|
+
state.pickup = clonePosition(PICKUP_RESPAWNS.triple);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (state.score % 2 === 0) {
|
|
34
|
+
state.pickup = clonePosition(PICKUP_RESPAWNS.even);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
state.pickup = clonePosition(PICKUP_RESPAWNS.odd);
|
|
39
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { HUD_TARGET_PICKUPS } from '../content/gameplay/course.js';
|
|
2
|
+
|
|
3
|
+
const hudScreen = {
|
|
4
|
+
id: 'hud',
|
|
5
|
+
kind: 'ui-screen',
|
|
6
|
+
role: 'hud',
|
|
7
|
+
draw: drawPlatformerHud,
|
|
8
|
+
notes: [
|
|
9
|
+
'HUD draw helpers still live beside the authored screen descriptor in this template.',
|
|
10
|
+
'Stage 138 mounts this screen through the app-level screen shell instead of scene-local booleans.',
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function createHudScreen() {
|
|
15
|
+
return hudScreen;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function drawPlatformerHud({ score, levelComplete, promptText = '', paused = false, showControlsHint = true }) {
|
|
19
|
+
let nextY = 12;
|
|
20
|
+
|
|
21
|
+
if (showControlsHint) {
|
|
22
|
+
aura.draw2d.text('Move: Arrows/WASD Jump: Space', 12, nextY, {
|
|
23
|
+
color: aura.Color.WHITE,
|
|
24
|
+
size: 14,
|
|
25
|
+
align: 'left',
|
|
26
|
+
});
|
|
27
|
+
nextY += 22;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
aura.draw2d.text(`Pickups ${score}/${HUD_TARGET_PICKUPS}`, 12, nextY, {
|
|
31
|
+
color: aura.Color.WHITE,
|
|
32
|
+
size: 14,
|
|
33
|
+
align: 'left',
|
|
34
|
+
});
|
|
35
|
+
nextY += 22;
|
|
36
|
+
aura.draw2d.text(`Reach checkpoints. Goal unlocks at ${HUD_TARGET_PICKUPS} pickups.`, 12, nextY, {
|
|
37
|
+
color: aura.Color.WHITE,
|
|
38
|
+
size: 13,
|
|
39
|
+
align: 'left',
|
|
40
|
+
});
|
|
41
|
+
nextY += 22;
|
|
42
|
+
|
|
43
|
+
if (promptText) {
|
|
44
|
+
aura.draw2d.text(promptText, 12, nextY, {
|
|
45
|
+
color: aura.rgb(0.96, 0.86, 0.42),
|
|
46
|
+
size: 13,
|
|
47
|
+
align: 'left',
|
|
48
|
+
});
|
|
49
|
+
nextY += 22;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (paused) {
|
|
53
|
+
aura.draw2d.text('Pause menu open. Press Esc to resume.', 12, nextY, {
|
|
54
|
+
color: aura.rgb(0.84, 0.9, 1.0),
|
|
55
|
+
size: 13,
|
|
56
|
+
align: 'left',
|
|
57
|
+
});
|
|
58
|
+
nextY += 24;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!levelComplete) return;
|
|
62
|
+
|
|
63
|
+
aura.draw2d.text('GOAL REACHED', 12, nextY, {
|
|
64
|
+
color: aura.rgb(0.5, 1.0, 0.64),
|
|
65
|
+
size: 24,
|
|
66
|
+
align: 'left',
|
|
67
|
+
});
|
|
68
|
+
aura.draw2d.text('Press Enter to restart', 12, nextY + 28, {
|
|
69
|
+
color: aura.Color.WHITE,
|
|
70
|
+
size: 16,
|
|
71
|
+
align: 'left',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default hudScreen;
|
|
@@ -0,0 +1,166 @@
|
|
|
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 productizes the pause flow as a retained authored screen mounted through screenShell.',
|
|
10
|
+
'Keep resume, restart, and settings actions here instead of scene-local booleans or draw2d hitboxes.',
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function sizeOfWindow() {
|
|
15
|
+
return aura.window?.getSize?.() || { width: 1360, height: 820 };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function themeLabel(context) {
|
|
19
|
+
const themeState = typeof context.getUiThemeState === 'function' ? context.getUiThemeState() : null;
|
|
20
|
+
return themeState?.presetLabel || 'Signal Dawn';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function densityLabel(context) {
|
|
24
|
+
const themeState = typeof context.getUiThemeState === 'function' ? context.getUiThemeState() : null;
|
|
25
|
+
return themeState?.density === 'compact' ? 'Compact' : 'Cozy';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function createPauseScreen() {
|
|
29
|
+
return pauseScreen;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function drawPauseScreen(data = {}, context = {}) {
|
|
33
|
+
const size = sizeOfWindow();
|
|
34
|
+
const panelWidth = Math.min(540, size.width - 72);
|
|
35
|
+
const panelHeight = Math.min(420, size.height - 88);
|
|
36
|
+
const panelX = Math.floor((size.width - panelWidth) * 0.5);
|
|
37
|
+
const panelY = Math.floor((size.height - panelHeight) * 0.5);
|
|
38
|
+
|
|
39
|
+
aura.draw2d.rect(0, 0, size.width, size.height, aura.rgba(0.03, 0.04, 0.08, 0.78));
|
|
40
|
+
|
|
41
|
+
aura.ui.beginView({
|
|
42
|
+
id: 'platformer-pause-root',
|
|
43
|
+
x: panelX,
|
|
44
|
+
y: panelY,
|
|
45
|
+
width: panelWidth,
|
|
46
|
+
height: panelHeight,
|
|
47
|
+
gap: 14,
|
|
48
|
+
padding: 18,
|
|
49
|
+
clip: true,
|
|
50
|
+
background: '#08111b',
|
|
51
|
+
borderColor: '#32506c',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
aura.ui.text('platformer-pause-eyebrow', {
|
|
55
|
+
text: 'PAUSE MENU',
|
|
56
|
+
size: 12,
|
|
57
|
+
color: '#86c1f5',
|
|
58
|
+
});
|
|
59
|
+
aura.ui.text('platformer-pause-title', {
|
|
60
|
+
text: 'Checkpoint run paused',
|
|
61
|
+
size: 28,
|
|
62
|
+
color: '#f4f8ff',
|
|
63
|
+
});
|
|
64
|
+
aura.ui.text('platformer-pause-intro', {
|
|
65
|
+
text: data.levelComplete
|
|
66
|
+
? 'You reached the goal route. Resume to finish cleanly or adjust the settings before the next run.'
|
|
67
|
+
: 'Resume to keep climbing, restart the route, or open settings without leaving the gameplay scene.',
|
|
68
|
+
size: 14,
|
|
69
|
+
color: '#c9d9ea',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
aura.ui.beginRow({
|
|
73
|
+
id: 'platformer-pause-shell',
|
|
74
|
+
gap: 16,
|
|
75
|
+
width: 'fill',
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
aura.ui.beginColumn({
|
|
79
|
+
id: 'platformer-pause-summary',
|
|
80
|
+
width: 210,
|
|
81
|
+
gap: 10,
|
|
82
|
+
padding: 14,
|
|
83
|
+
background: '#0d1826',
|
|
84
|
+
borderColor: '#21384d',
|
|
85
|
+
});
|
|
86
|
+
aura.ui.text('platformer-pause-summary-label', {
|
|
87
|
+
text: 'RUN SNAPSHOT',
|
|
88
|
+
size: 11,
|
|
89
|
+
color: '#7fb7ea',
|
|
90
|
+
});
|
|
91
|
+
aura.ui.text('platformer-pause-score', {
|
|
92
|
+
text: `Pickups ${data.score ?? 0}`,
|
|
93
|
+
size: 18,
|
|
94
|
+
color: '#eef5ff',
|
|
95
|
+
});
|
|
96
|
+
aura.ui.text('platformer-pause-theme', {
|
|
97
|
+
text: `Theme ${themeLabel(context)}`,
|
|
98
|
+
size: 14,
|
|
99
|
+
color: '#d1dfef',
|
|
100
|
+
});
|
|
101
|
+
aura.ui.text('platformer-pause-density', {
|
|
102
|
+
text: `Density ${densityLabel(context)}`,
|
|
103
|
+
size: 14,
|
|
104
|
+
color: '#d1dfef',
|
|
105
|
+
});
|
|
106
|
+
aura.ui.text('platformer-pause-status', {
|
|
107
|
+
text: data.levelComplete ? 'Goal unlocked and ready.' : 'Checkpoint route still active.',
|
|
108
|
+
size: 13,
|
|
109
|
+
color: '#f0cf79',
|
|
110
|
+
});
|
|
111
|
+
aura.ui.endColumn();
|
|
112
|
+
|
|
113
|
+
aura.ui.beginColumn({
|
|
114
|
+
id: 'platformer-pause-actions-col',
|
|
115
|
+
width: 'fill',
|
|
116
|
+
gap: 12,
|
|
117
|
+
padding: 14,
|
|
118
|
+
background: '#0d1826',
|
|
119
|
+
borderColor: '#21384d',
|
|
120
|
+
});
|
|
121
|
+
aura.ui.text('platformer-pause-actions-label', {
|
|
122
|
+
text: 'QUICK ACTIONS',
|
|
123
|
+
size: 11,
|
|
124
|
+
color: '#7fb7ea',
|
|
125
|
+
});
|
|
126
|
+
aura.ui.text('platformer-pause-actions-copy', {
|
|
127
|
+
text: 'Resume keeps the current shell state. Settings edits the shared appState.ui preferences slice live.',
|
|
128
|
+
size: 13,
|
|
129
|
+
color: '#d1dfef',
|
|
130
|
+
});
|
|
131
|
+
const actions = renderActionStrip({
|
|
132
|
+
id: 'platformer-pause-actions',
|
|
133
|
+
actions: [
|
|
134
|
+
{ id: 'resume', label: 'Resume' },
|
|
135
|
+
{ id: 'settings', label: 'Settings' },
|
|
136
|
+
{ id: 'restart', label: 'Restart Run' },
|
|
137
|
+
],
|
|
138
|
+
});
|
|
139
|
+
aura.ui.text('platformer-pause-shortcuts', {
|
|
140
|
+
text: 'Esc closes the top modal. Theme changes stay shared in appState.ui.preferences.',
|
|
141
|
+
size: 12,
|
|
142
|
+
color: '#9db2cb',
|
|
143
|
+
});
|
|
144
|
+
aura.ui.endColumn();
|
|
145
|
+
|
|
146
|
+
aura.ui.endRow();
|
|
147
|
+
aura.ui.endView();
|
|
148
|
+
|
|
149
|
+
if (actions.actionId === 'resume') {
|
|
150
|
+
context.popModalScreen?.({ action: 'resume' });
|
|
151
|
+
} else if (actions.actionId === 'settings') {
|
|
152
|
+
context.pushModalScreen?.('settings', {
|
|
153
|
+
source: 'pause',
|
|
154
|
+
score: data.score ?? 0,
|
|
155
|
+
});
|
|
156
|
+
} else if (actions.actionId === 'restart') {
|
|
157
|
+
context.popModalScreen?.({ action: 'restart' });
|
|
158
|
+
if (typeof context.restartCurrentScene === 'function') {
|
|
159
|
+
context.restartCurrentScene();
|
|
160
|
+
} else {
|
|
161
|
+
context.replaceScene?.('gameplay');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default pauseScreen;
|