@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,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "aurajs.checkpoints.v1",
|
|
3
|
+
"checkpoints": [
|
|
4
|
+
{
|
|
5
|
+
"id": "spawn",
|
|
6
|
+
"x": 0,
|
|
7
|
+
"y": 1.1,
|
|
8
|
+
"z": 5.5,
|
|
9
|
+
"radius": 1.4
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "ridge-a",
|
|
13
|
+
"x": -3.2,
|
|
14
|
+
"y": 2,
|
|
15
|
+
"z": -2.4,
|
|
16
|
+
"radius": 1.25
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "ridge-b",
|
|
20
|
+
"x": 1.4,
|
|
21
|
+
"y": 3.2,
|
|
22
|
+
"z": -0.8,
|
|
23
|
+
"radius": 1.25
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "goal",
|
|
27
|
+
"x": 4.4,
|
|
28
|
+
"y": 4.6,
|
|
29
|
+
"z": -3,
|
|
30
|
+
"radius": 1.3
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const PLAYER_HALF = { x: 0.45, y: 0.55, z: 0.45 };
|
|
2
|
+
export const MOVE_SPEED = 5.3;
|
|
3
|
+
export const JUMP_SPEED = 8.2;
|
|
4
|
+
export const GRAVITY = 20.0;
|
|
5
|
+
export const WORLD_LIMIT = 9.0;
|
|
6
|
+
export const HUD_TARGET_PICKUPS = 3;
|
|
7
|
+
|
|
8
|
+
export const FLOOR_SCALE = { x: 24, y: 1, z: 24 };
|
|
9
|
+
export const PLAYER_SPAWN = { x: 0, y: 1.1, z: 5.5 };
|
|
10
|
+
export const CAMERA_OFFSET = { x: 7.4, y: 6.0, z: 8.8 };
|
|
11
|
+
export const CAMERA_LOOK_OFFSET = { x: 0, y: 0.2, z: 0 };
|
|
12
|
+
|
|
13
|
+
export const STATIC_PLATFORMS = [
|
|
14
|
+
{ x: -3.2, y: 1.2, z: -2.4, sx: 3.0, sy: 0.5, sz: 2.2 },
|
|
15
|
+
{ x: 1.4, y: 2.4, z: -0.8, sx: 2.8, sy: 0.5, sz: 2.0 },
|
|
16
|
+
{ x: 4.4, y: 3.8, z: -3.0, sx: 3.4, sy: 0.5, sz: 2.0 },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const CHECKPOINTS = [
|
|
20
|
+
{ x: 0, y: 1.1, z: 5.5, radius: 1.4 },
|
|
21
|
+
{ x: -3.2, y: 2.0, z: -2.4, radius: 1.25 },
|
|
22
|
+
{ x: 1.4, y: 3.2, z: -0.8, radius: 1.25 },
|
|
23
|
+
{ x: 4.4, y: 4.6, z: -3.0, radius: 1.3 },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
export const MOVING_PLATFORM = {
|
|
27
|
+
from: { x: -0.2, y: 1.8, z: 2.2 },
|
|
28
|
+
to: { x: 3.1, y: 3.0, z: 0.8 },
|
|
29
|
+
size: { x: 2.4, y: 0.4, z: 2.0 },
|
|
30
|
+
periodSeconds: 3.2,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const PICKUP_START = { x: 4.4, y: 4.6, z: -3.0 };
|
|
34
|
+
export const PICKUP_RESPAWNS = {
|
|
35
|
+
odd: { x: 1.4, y: 3.2, z: -0.8 },
|
|
36
|
+
even: { x: -3.2, y: 2.0, z: -2.4 },
|
|
37
|
+
triple: { x: 0, y: 3.0, z: -4.0 },
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const GOAL_ZONE = { x: 4.4, y: 4.8, z: -3.0, radius: 1.15 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# 3D Platformer Loop
|
|
2
|
+
|
|
3
|
+
1. Traverse the course, hit checkpoints, collect pickups, and reach the goal.
|
|
4
|
+
1. Keep authored route nouns in `content/gameplay/course.js`, checkpoint data in `content/gameplay/checkpoints.json`, and shared starter/runtime wiring in `src/runtime/`.
|
|
5
|
+
1. If you add template-specific tuning beyond `game.config.json`, keep it in `config/gameplay/` instead of burying it in scene constants.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const checkpointPrefab = {
|
|
2
|
+
id: 'checkpoint',
|
|
3
|
+
kind: 'prefab',
|
|
4
|
+
role: 'world',
|
|
5
|
+
view: { kind: 'marker3d' },
|
|
6
|
+
components: {},
|
|
7
|
+
hooks: {},
|
|
8
|
+
notes: ['Attach VFX/material state here as platformer polish increases.'],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function createCheckpointPrefab() {
|
|
12
|
+
return checkpointPrefab;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default checkpointPrefab;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
activeCheckpoint,
|
|
3
|
+
createCharacterAvatar3D,
|
|
4
|
+
setAvatarVisual3D,
|
|
5
|
+
} from '../src/starter-utils/index.js';
|
|
6
|
+
import {
|
|
7
|
+
CAMERA_LOOK_OFFSET,
|
|
8
|
+
CAMERA_OFFSET,
|
|
9
|
+
JUMP_SPEED,
|
|
10
|
+
MOVE_SPEED,
|
|
11
|
+
PLAYER_HALF,
|
|
12
|
+
} from '../content/gameplay/course.js';
|
|
13
|
+
|
|
14
|
+
export const PLAYER_AVATAR_MODEL_PATH = 'assets/models/starter-avatar.gltf';
|
|
15
|
+
|
|
16
|
+
const PLAYER_BODY_HEIGHT = PLAYER_HALF.y * 2;
|
|
17
|
+
const PLAYER_RUN_SPEED = MOVE_SPEED * 1.35;
|
|
18
|
+
const PLAYER_VISUAL_OFFSET = { x: 0, y: -PLAYER_HALF.y, z: 0 };
|
|
19
|
+
const PLAYER_VISUAL_SCALE = { x: 1, y: 1, z: 1 };
|
|
20
|
+
|
|
21
|
+
const playerPrefab = {
|
|
22
|
+
id: 'player',
|
|
23
|
+
kind: 'prefab',
|
|
24
|
+
role: 'player',
|
|
25
|
+
view: {
|
|
26
|
+
kind: 'avatar3d',
|
|
27
|
+
collider: { shape: 'capsule', size: { x: PLAYER_HALF.x * 2, y: PLAYER_BODY_HEIGHT, z: PLAYER_HALF.z * 2 } },
|
|
28
|
+
asset: { path: PLAYER_AVATAR_MODEL_PATH, clips: ['Idle', 'Walk', 'Run', 'Jump', 'Fall'] },
|
|
29
|
+
},
|
|
30
|
+
components: {
|
|
31
|
+
avatar: {
|
|
32
|
+
model: PLAYER_AVATAR_MODEL_PATH,
|
|
33
|
+
clips: ['Idle', 'Walk', 'Run', 'Jump', 'Fall'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
hooks: {
|
|
37
|
+
bindVisual: 'bindPlayerAvatarVisual',
|
|
38
|
+
},
|
|
39
|
+
notes: ['This starter keeps the player prefab avatar-first so the shipped 3D loop exercises imported animation immediately.'],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
function normalizeImportedSceneRecord(entry) {
|
|
43
|
+
if (entry && entry.ok === true && Number.isInteger(entry.importId) && entry.importId > 0) {
|
|
44
|
+
return entry;
|
|
45
|
+
}
|
|
46
|
+
if (entry && Number.isInteger(entry.importId) && entry.importId > 0) {
|
|
47
|
+
return { ok: true, ...entry };
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function resolveImportId(entry) {
|
|
53
|
+
if (Number.isInteger(entry) && entry > 0) return entry;
|
|
54
|
+
if (Number.isInteger(entry?.importId) && entry.importId > 0) return entry.importId;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function resolveRootSceneNodeId(record) {
|
|
59
|
+
if (!record || !Array.isArray(record.nodeHandles) || record.nodeHandles.length === 0) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const rootSourceIndex = Array.isArray(record.rootSourceNodeIndices) && record.rootSourceNodeIndices.length > 0
|
|
64
|
+
? Number(record.rootSourceNodeIndices[0])
|
|
65
|
+
: null;
|
|
66
|
+
if (Number.isInteger(rootSourceIndex) && rootSourceIndex >= 0) {
|
|
67
|
+
const match = record.nodeHandles.find((entry) => Number(entry?.sourceNodeIndex) === rootSourceIndex);
|
|
68
|
+
if (Number.isInteger(match?.nodeId) && match.nodeId > 0) {
|
|
69
|
+
return match.nodeId;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const first = record.nodeHandles.find((entry) => Number.isInteger(entry?.nodeId) && entry.nodeId > 0);
|
|
74
|
+
return Number.isInteger(first?.nodeId) ? first.nodeId : null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function createPlayerClipMap(importId) {
|
|
78
|
+
return {
|
|
79
|
+
idle: { importId, animation: 'Idle', loop: true, transitionSeconds: 0.18 },
|
|
80
|
+
walk: { importId, animation: 'Walk', loop: true, transitionSeconds: 0.14 },
|
|
81
|
+
run: { importId, animation: 'Run', loop: true, transitionSeconds: 0.1 },
|
|
82
|
+
jump: { importId, animation: 'Jump', loop: false, transitionSeconds: 0.08 },
|
|
83
|
+
fall: { importId, animation: 'Fall', loop: true, transitionSeconds: 0.08 },
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function createPlayerAvatar(spawn) {
|
|
88
|
+
return createCharacterAvatar3D({
|
|
89
|
+
position: spawn,
|
|
90
|
+
radius: PLAYER_HALF.x,
|
|
91
|
+
height: PLAYER_BODY_HEIGHT,
|
|
92
|
+
moveSpeed: MOVE_SPEED,
|
|
93
|
+
runSpeed: PLAYER_RUN_SPEED,
|
|
94
|
+
jumpSpeed: JUMP_SPEED,
|
|
95
|
+
visual: {
|
|
96
|
+
offset: PLAYER_VISUAL_OFFSET,
|
|
97
|
+
scale: PLAYER_VISUAL_SCALE,
|
|
98
|
+
},
|
|
99
|
+
camera: {
|
|
100
|
+
offset: CAMERA_OFFSET,
|
|
101
|
+
lookOffset: CAMERA_LOOK_OFFSET,
|
|
102
|
+
rotateWithFacing: false,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function resetPlayerAvatar(avatar, spawn) {
|
|
108
|
+
avatar.position = { x: spawn.x, y: spawn.y, z: spawn.z };
|
|
109
|
+
avatar.grounded = false;
|
|
110
|
+
avatar.onSlope = false;
|
|
111
|
+
avatar.velocityY = 0;
|
|
112
|
+
avatar.facingYaw = 0;
|
|
113
|
+
avatar.locomotion = 'idle';
|
|
114
|
+
avatar.motion = {
|
|
115
|
+
moveX: 0,
|
|
116
|
+
moveZ: 0,
|
|
117
|
+
magnitude: 0,
|
|
118
|
+
speed: 0,
|
|
119
|
+
};
|
|
120
|
+
avatar.input = {
|
|
121
|
+
moveX: 0,
|
|
122
|
+
moveZ: 0,
|
|
123
|
+
jump: false,
|
|
124
|
+
run: false,
|
|
125
|
+
};
|
|
126
|
+
avatar.visual.activeClipKey = null;
|
|
127
|
+
avatar.visual.activeClipId = null;
|
|
128
|
+
return avatar;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function loadPlayerAvatarVisual() {
|
|
132
|
+
const loaded = aura.scene3d.loadGltfScene(PLAYER_AVATAR_MODEL_PATH, {
|
|
133
|
+
bindRenderNodes: true,
|
|
134
|
+
visible: true,
|
|
135
|
+
cull: false,
|
|
136
|
+
});
|
|
137
|
+
const importId = resolveImportId(loaded);
|
|
138
|
+
if (!importId) {
|
|
139
|
+
throw new Error(`[3d-platformer-template] failed to load starter avatar model: ${PLAYER_AVATAR_MODEL_PATH}`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const record = normalizeImportedSceneRecord(loaded)
|
|
143
|
+
|| normalizeImportedSceneRecord(aura.scene3d.getImportedScene(importId));
|
|
144
|
+
const sceneNodeId = resolveRootSceneNodeId(record);
|
|
145
|
+
if (!sceneNodeId) {
|
|
146
|
+
throw new Error('[3d-platformer-template] starter avatar model missing a bindable root scene node');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
importId,
|
|
151
|
+
path: PLAYER_AVATAR_MODEL_PATH,
|
|
152
|
+
sceneNodeId,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function bindPlayerAvatarVisual(avatar, visual) {
|
|
157
|
+
return setAvatarVisual3D(avatar, {
|
|
158
|
+
sceneNodeId: visual.sceneNodeId,
|
|
159
|
+
offset: PLAYER_VISUAL_OFFSET,
|
|
160
|
+
scale: PLAYER_VISUAL_SCALE,
|
|
161
|
+
clipMap: createPlayerClipMap(visual.importId),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function createPlayerPrefab() {
|
|
166
|
+
return playerPrefab;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function drawPlatformerActors({ mesh, materials, state, goalZone }) {
|
|
170
|
+
aura.draw3d.drawMesh(mesh, materials.pickup, {
|
|
171
|
+
position: {
|
|
172
|
+
x: state.pickup.x,
|
|
173
|
+
y: state.pickup.y + (Math.sin(state.elapsed * 2.5) * 0.2),
|
|
174
|
+
z: state.pickup.z,
|
|
175
|
+
},
|
|
176
|
+
rotation: {
|
|
177
|
+
x: state.elapsed * 0.4,
|
|
178
|
+
y: state.elapsed * 1.5,
|
|
179
|
+
z: state.elapsed * 0.3,
|
|
180
|
+
},
|
|
181
|
+
scale: { x: 0.55, y: 0.55, z: 0.55 },
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const checkpoint = activeCheckpoint(state.checkpointSystem);
|
|
185
|
+
if (checkpoint) {
|
|
186
|
+
aura.draw3d.drawMesh(mesh, materials.checkpoint, {
|
|
187
|
+
position: { x: checkpoint.x, y: checkpoint.y - 0.4, z: checkpoint.z },
|
|
188
|
+
rotation: { x: 0, y: state.elapsed * 0.7, z: 0 },
|
|
189
|
+
scale: { x: 0.45, y: 0.45, z: 0.45 },
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
aura.draw3d.drawMesh(mesh, materials.goal, {
|
|
194
|
+
position: { x: goalZone.x, y: goalZone.y, z: goalZone.z },
|
|
195
|
+
rotation: { x: 0, y: state.elapsed * 0.9, z: 0 },
|
|
196
|
+
scale: {
|
|
197
|
+
x: goalZone.radius * 1.2,
|
|
198
|
+
y: goalZone.radius * 1.2,
|
|
199
|
+
z: goalZone.radius * 1.2,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export default playerPrefab;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { FLOOR_SCALE, STATIC_PLATFORMS } from '../content/gameplay/course.js';
|
|
2
|
+
|
|
3
|
+
const worldPrefab = {
|
|
4
|
+
id: 'world',
|
|
5
|
+
kind: 'prefab',
|
|
6
|
+
role: 'world',
|
|
7
|
+
view: {
|
|
8
|
+
kind: 'environment3d',
|
|
9
|
+
},
|
|
10
|
+
hooks: {},
|
|
11
|
+
notes: ['Treat this as the authored course descriptor before you move to richer scene data.'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function createWorldPrefab() {
|
|
15
|
+
return {
|
|
16
|
+
...worldPrefab,
|
|
17
|
+
platformCount: STATIC_PLATFORMS.length,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function addObstacleBox(platform) {
|
|
22
|
+
const halfX = platform.sx * 0.5;
|
|
23
|
+
const halfY = platform.sy * 0.5;
|
|
24
|
+
const halfZ = platform.sz * 0.5;
|
|
25
|
+
aura.character3d.addObstacle(
|
|
26
|
+
{ x: platform.x - halfX, y: platform.y - halfY, z: platform.z - halfZ },
|
|
27
|
+
{ x: platform.x + halfX, y: platform.y + halfY, z: platform.z + halfZ },
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function findSupportTop(x, z, movingPlatform) {
|
|
32
|
+
let top = 0;
|
|
33
|
+
|
|
34
|
+
const includePlatform = (platform) => {
|
|
35
|
+
const halfX = platform.sx * 0.5;
|
|
36
|
+
const halfZ = platform.sz * 0.5;
|
|
37
|
+
if (Math.abs(x - platform.x) > halfX || Math.abs(z - platform.z) > halfZ) return;
|
|
38
|
+
top = Math.max(top, platform.y + (platform.sy * 0.5));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
for (const platform of STATIC_PLATFORMS) {
|
|
42
|
+
includePlatform(platform);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
includePlatform({
|
|
46
|
+
x: movingPlatform.position.x,
|
|
47
|
+
y: movingPlatform.position.y,
|
|
48
|
+
z: movingPlatform.position.z,
|
|
49
|
+
sx: movingPlatform.size.x,
|
|
50
|
+
sy: movingPlatform.size.y,
|
|
51
|
+
sz: movingPlatform.size.z,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return top;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function syncPlatformerCharacterObstacles(movingPlatform) {
|
|
58
|
+
if (typeof aura?.character3d?.clearObstacles !== 'function' || typeof aura?.character3d?.addObstacle !== 'function') {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
aura.character3d.clearObstacles();
|
|
63
|
+
aura.character3d.addObstacle(
|
|
64
|
+
{ x: -FLOOR_SCALE.x * 0.5, y: -1.0, z: -FLOOR_SCALE.z * 0.5 },
|
|
65
|
+
{ x: FLOOR_SCALE.x * 0.5, y: 0.0, z: FLOOR_SCALE.z * 0.5 },
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
for (const platform of STATIC_PLATFORMS) {
|
|
69
|
+
addObstacleBox(platform);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
addObstacleBox({
|
|
73
|
+
x: movingPlatform.position.x,
|
|
74
|
+
y: movingPlatform.position.y,
|
|
75
|
+
z: movingPlatform.position.z,
|
|
76
|
+
sx: movingPlatform.size.x,
|
|
77
|
+
sy: movingPlatform.size.y,
|
|
78
|
+
sz: movingPlatform.size.z,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function drawPlatformerCourse({ mesh, floorMaterial, platformMaterial, movingPlatform }) {
|
|
83
|
+
aura.draw3d.drawMesh(mesh, floorMaterial, {
|
|
84
|
+
position: { x: 0, y: -0.5, z: 0 },
|
|
85
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
86
|
+
scale: FLOOR_SCALE,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
for (const platform of STATIC_PLATFORMS) {
|
|
90
|
+
aura.draw3d.drawMesh(mesh, platformMaterial, {
|
|
91
|
+
position: { x: platform.x, y: platform.y, z: platform.z },
|
|
92
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
93
|
+
scale: { x: platform.sx, y: platform.sy, z: platform.sz },
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
aura.draw3d.drawMesh(mesh, platformMaterial, {
|
|
98
|
+
position: {
|
|
99
|
+
x: movingPlatform.position.x,
|
|
100
|
+
y: movingPlatform.position.y,
|
|
101
|
+
z: movingPlatform.position.z,
|
|
102
|
+
},
|
|
103
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
104
|
+
scale: {
|
|
105
|
+
x: movingPlatform.size.x,
|
|
106
|
+
y: movingPlatform.size.y,
|
|
107
|
+
z: movingPlatform.size.z,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default worldPrefab;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function createBootScene() {
|
|
2
|
+
return {
|
|
3
|
+
id: 'boot',
|
|
4
|
+
template: '3d-platformer',
|
|
5
|
+
nextSceneId: 'gameplay',
|
|
6
|
+
notes: [
|
|
7
|
+
'Use this scene for splash, loading, title flow, and session handoff.',
|
|
8
|
+
'Keep long-lived boot orchestration here instead of bloating src/main.js.',
|
|
9
|
+
'Keep checkpoint resume and route handoff in appState or scene data instead of ad hoc globals.',
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
}
|