@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.
Files changed (334) hide show
  1. package/README.md +98 -2
  2. package/benchmarks/perf-thresholds.json +54 -0
  3. package/package.json +4 -7
  4. package/src/asset-pack.mjs +5 -1
  5. package/src/authored-project.mjs +1449 -0
  6. package/src/authored-runtime.mjs +2016 -0
  7. package/src/authoring/avatar-animation-graph.mjs +648 -0
  8. package/src/bin-integrity.mjs +272 -0
  9. package/src/build-contract/assets.mjs +130 -0
  10. package/src/build-contract/capabilities.mjs +116 -0
  11. package/src/build-contract/constants.mjs +6 -0
  12. package/src/build-contract/helpers.mjs +44 -0
  13. package/src/build-contract/web-templates.mjs +5993 -0
  14. package/src/build-contract.mjs +27 -2910
  15. package/src/bundler.mjs +188 -55
  16. package/src/cli.mjs +4825 -1512
  17. package/src/commands/project-authoring.mjs +434 -0
  18. package/src/config.mjs +27 -0
  19. package/src/conformance/cases/app-and-ui-runtime-cases.mjs +3309 -0
  20. package/src/conformance/cases/core-runtime-cases.mjs +1431 -0
  21. package/src/conformance/cases/index.mjs +11 -0
  22. package/src/conformance/cases/scene3d-and-media-cases.mjs +2094 -0
  23. package/src/conformance/cases/systems-and-gameplay-cases.mjs +1776 -0
  24. package/src/conformance/shared.mjs +27 -0
  25. package/src/conformance-runner.mjs +25 -13
  26. package/src/conformance.mjs +619 -4020
  27. package/src/cutscene.mjs +362 -5
  28. package/src/dev-cli-action.mjs +249 -0
  29. package/src/dev-cli-inspect.mjs +92 -0
  30. package/src/dev-cli-state.mjs +80 -0
  31. package/src/external-asset-cache.mjs +587 -0
  32. package/src/external-asset-policy.mjs +217 -0
  33. package/src/external-package-surface.mjs +206 -0
  34. package/src/game-action-runtime.mjs +869 -0
  35. package/src/game-state-runtime.mjs +206 -6
  36. package/src/headless-action.mjs +186 -0
  37. package/src/headless-test/runtime-animation.mjs +1173 -0
  38. package/src/headless-test/runtime-coordinator.mjs +1514 -0
  39. package/src/headless-test/runtime-primitives.mjs +320 -0
  40. package/src/headless-test/runtime-world.mjs +2253 -0
  41. package/src/headless-test.mjs +392 -4298
  42. package/src/host-binary.mjs +342 -14
  43. package/src/icon-discovery.mjs +64 -0
  44. package/src/make-catalog.mjs +109 -0
  45. package/src/make.mjs +197 -0
  46. package/src/package-integrity.mjs +586 -0
  47. package/src/perf-benchmark.mjs +353 -0
  48. package/src/postinstall.mjs +5 -5
  49. package/src/prefabs/index.mjs +34 -0
  50. package/src/prefabs/scene-serialization.mjs +184 -0
  51. package/src/project-importer.mjs +620 -0
  52. package/src/project-registry.mjs +24 -0
  53. package/src/publish-command.mjs +195 -0
  54. package/src/publish-env-example.mjs +83 -0
  55. package/src/publish-validation.mjs +708 -0
  56. package/src/retro/assets/compile.mjs +232 -0
  57. package/src/retro/backend-gba/authoring.mjs +1029 -0
  58. package/src/retro/backend-gba/rom.mjs +363 -0
  59. package/src/retro/backend-gbc/rom.mjs +85 -0
  60. package/src/retro/build.mjs +278 -0
  61. package/src/retro/cli/commands.mjs +292 -0
  62. package/src/retro/cli/templates.mjs +84 -0
  63. package/src/retro/diagnostics/catalog.mjs +110 -0
  64. package/src/retro/diagnostics/emit.mjs +72 -0
  65. package/src/retro/emulator/case-overlay.mjs +64 -0
  66. package/src/retro/emulator/discovery.mjs +158 -0
  67. package/src/retro/emulator/macos-case-overlay.swift +220 -0
  68. package/src/retro/emulator/profiles.mjs +146 -0
  69. package/src/retro/emulator/runner.mjs +289 -0
  70. package/src/retro/frontend/load-project.mjs +98 -0
  71. package/src/retro/index.mjs +30 -0
  72. package/src/retro/ir/build-ir.mjs +108 -0
  73. package/src/retro/runtime-gba/contract.mjs +151 -0
  74. package/src/retro/runtime-gbc/contract.mjs +117 -0
  75. package/src/retro/shared/span.mjs +26 -0
  76. package/src/retro/shared/targets.mjs +64 -0
  77. package/src/retro/validator/check-project.mjs +114 -0
  78. package/src/runtime-hotspot-audit.mjs +707 -0
  79. package/src/scaffold/config.mjs +1000 -0
  80. package/src/scaffold/fs.mjs +56 -0
  81. package/src/scaffold/layout.mjs +318 -0
  82. package/src/scaffold/project-docs.mjs +438 -0
  83. package/src/scaffold.mjs +93 -596
  84. package/src/scene-composition/index.mjs +326 -0
  85. package/src/scene-composition/runtime.mjs +751 -0
  86. package/src/self-hosted-assets.mjs +604 -0
  87. package/src/session-client.mjs +750 -0
  88. package/src/session-native-launcher.mjs +74 -0
  89. package/src/session-protocol.mjs +75 -0
  90. package/src/session-runtime.mjs +321 -0
  91. package/src/session-server.mjs +360 -0
  92. package/src/shader-kits/index.mjs +773 -0
  93. package/src/starter-content-registry.mjs +292 -0
  94. package/src/state-artifacts.mjs +662 -24
  95. package/src/state-dev-reload.mjs +99 -2
  96. package/src/terminal-ui.mjs +245 -0
  97. package/src/web-conformance.mjs +219 -0
  98. package/templates/create/2d/config/gameplay/shooter.config.js +26 -0
  99. package/templates/create/2d/content/gameplay/waves.json +26 -0
  100. package/templates/create/2d/content/registries/.gitkeep +1 -0
  101. package/templates/create/2d/docs/design/.gitkeep +1 -0
  102. package/templates/create/2d/docs/design/loop.md +5 -0
  103. package/templates/create/2d/prefabs/enemies.prefab.js +90 -0
  104. package/templates/create/2d/prefabs/enemy-basic.prefab.js +18 -0
  105. package/templates/create/2d/prefabs/player.prefab.js +36 -0
  106. package/templates/create/2d/prefabs/projectiles.prefab.js +35 -0
  107. package/templates/create/2d/scenes/boot.scene.js +12 -0
  108. package/templates/create/2d/scenes/gameplay.scene.js +230 -0
  109. package/templates/create/2d/scenes/menu.scene.js +9 -0
  110. package/templates/create/2d/src/main.js +6 -185
  111. package/templates/create/2d/src/runtime/app.js +49 -0
  112. package/templates/create/2d/src/runtime/capabilities.js +35 -0
  113. package/templates/create/2d/ui/hud.screen.js +40 -0
  114. package/templates/create/2d/ui/pause.screen.js +149 -0
  115. package/templates/create/2d/ui/settings.screen.js +347 -0
  116. package/templates/create/2d/ui/title.screen.js +13 -0
  117. package/templates/create/2d-adventure/aura.config.json +28 -0
  118. package/templates/create/2d-adventure/config/gameplay/adventure.config.js +14 -0
  119. package/templates/create/2d-adventure/content/gameplay/world.js +46 -0
  120. package/templates/create/2d-adventure/content/registries/.gitkeep +1 -0
  121. package/templates/create/2d-adventure/docs/design/loop.md +5 -0
  122. package/templates/create/2d-adventure/prefabs/player.prefab.js +54 -0
  123. package/templates/create/2d-adventure/prefabs/relic.prefab.js +38 -0
  124. package/templates/create/2d-adventure/prefabs/world.prefab.js +125 -0
  125. package/templates/create/2d-adventure/scenes/gameplay.scene.js +256 -0
  126. package/templates/create/2d-adventure/src/runtime/capabilities.js +34 -0
  127. package/templates/create/2d-adventure/ui/hud.screen.js +60 -0
  128. package/templates/create/2d-survivor/config/gameplay/survivor.config.js +33 -0
  129. package/templates/create/2d-survivor/content/gameplay/spawn-zones.json +29 -0
  130. package/templates/create/2d-survivor/content/registries/.gitkeep +1 -0
  131. package/templates/create/2d-survivor/docs/design/.gitkeep +1 -0
  132. package/templates/create/2d-survivor/docs/design/loop.md +5 -0
  133. package/templates/create/2d-survivor/prefabs/enemies.prefab.js +178 -0
  134. package/templates/create/2d-survivor/prefabs/enemy-swarm.prefab.js +18 -0
  135. package/templates/create/2d-survivor/prefabs/player.prefab.js +42 -0
  136. package/templates/create/2d-survivor/prefabs/projectiles.prefab.js +56 -0
  137. package/templates/create/2d-survivor/scenes/boot.scene.js +12 -0
  138. package/templates/create/2d-survivor/scenes/gameplay.scene.js +314 -0
  139. package/templates/create/2d-survivor/scenes/menu.scene.js +9 -0
  140. package/templates/create/2d-survivor/src/main.js +5 -332
  141. package/templates/create/2d-survivor/src/runtime/app.js +49 -0
  142. package/templates/create/2d-survivor/src/runtime/capabilities.js +35 -0
  143. package/templates/create/2d-survivor/ui/hud.screen.js +45 -0
  144. package/templates/create/2d-survivor/ui/title.screen.js +13 -0
  145. package/templates/create/3d/assets/models/starter-avatar.gltf +184 -0
  146. package/templates/create/3d/config/gameplay/.gitkeep +1 -0
  147. package/templates/create/3d/content/gameplay/checkpoints.json +33 -0
  148. package/templates/create/3d/content/gameplay/course.js +40 -0
  149. package/templates/create/3d/content/registries/.gitkeep +1 -0
  150. package/templates/create/3d/docs/design/.gitkeep +1 -0
  151. package/templates/create/3d/docs/design/loop.md +5 -0
  152. package/templates/create/3d/prefabs/checkpoint.prefab.js +15 -0
  153. package/templates/create/3d/prefabs/player.prefab.js +204 -0
  154. package/templates/create/3d/prefabs/world.prefab.js +112 -0
  155. package/templates/create/3d/scenes/boot.scene.js +12 -0
  156. package/templates/create/3d/scenes/checkpoint.scene.js +9 -0
  157. package/templates/create/3d/scenes/gameplay.scene.js +292 -0
  158. package/templates/create/3d/src/main.js +6 -295
  159. package/templates/create/3d/src/runtime/app.js +49 -0
  160. package/templates/create/3d/src/runtime/capabilities.js +53 -0
  161. package/templates/create/3d/src/runtime/materials.js +34 -0
  162. package/templates/create/3d/src/runtime/state.js +39 -0
  163. package/templates/create/3d/ui/hud.screen.js +75 -0
  164. package/templates/create/3d/ui/pause.screen.js +166 -0
  165. package/templates/create/3d/ui/settings.screen.js +387 -0
  166. package/templates/create/3d-adventure/assets/models/starter-avatar.gltf +184 -0
  167. package/templates/create/3d-adventure/aura.config.json +28 -0
  168. package/templates/create/3d-adventure/config/gameplay/adventure.config.js +9 -0
  169. package/templates/create/3d-adventure/content/gameplay/course.js +62 -0
  170. package/templates/create/3d-adventure/content/registries/.gitkeep +1 -0
  171. package/templates/create/3d-adventure/docs/design/loop.md +5 -0
  172. package/templates/create/3d-adventure/prefabs/player.prefab.js +168 -0
  173. package/templates/create/3d-adventure/prefabs/relic.prefab.js +35 -0
  174. package/templates/create/3d-adventure/prefabs/world.prefab.js +119 -0
  175. package/templates/create/3d-adventure/scenes/gameplay.scene.js +358 -0
  176. package/templates/create/3d-adventure/src/runtime/capabilities.js +56 -0
  177. package/templates/create/3d-adventure/src/runtime/materials.js +39 -0
  178. package/templates/create/3d-adventure/src/runtime/state.js +31 -0
  179. package/templates/create/3d-adventure/ui/hud.screen.js +70 -0
  180. package/templates/create/3d-adventure/ui/pause.screen.js +437 -0
  181. package/templates/create/3d-collectathon/assets/models/starter-avatar.gltf +184 -0
  182. package/templates/create/3d-collectathon/config/gameplay/.gitkeep +1 -0
  183. package/templates/create/3d-collectathon/content/gameplay/collectibles.json +26 -0
  184. package/templates/create/3d-collectathon/content/gameplay/course.js +46 -0
  185. package/templates/create/3d-collectathon/content/registries/.gitkeep +1 -0
  186. package/templates/create/3d-collectathon/docs/design/.gitkeep +1 -0
  187. package/templates/create/3d-collectathon/docs/design/loop.md +5 -0
  188. package/templates/create/3d-collectathon/prefabs/collectible.prefab.js +15 -0
  189. package/templates/create/3d-collectathon/prefabs/player.prefab.js +207 -0
  190. package/templates/create/3d-collectathon/prefabs/world.prefab.js +112 -0
  191. package/templates/create/3d-collectathon/scenes/boot.scene.js +12 -0
  192. package/templates/create/3d-collectathon/scenes/checkpoint.scene.js +9 -0
  193. package/templates/create/3d-collectathon/scenes/gameplay.scene.js +200 -0
  194. package/templates/create/3d-collectathon/src/main.js +5 -355
  195. package/templates/create/3d-collectathon/src/runtime/app.js +49 -0
  196. package/templates/create/3d-collectathon/src/runtime/capabilities.js +53 -0
  197. package/templates/create/3d-collectathon/src/runtime/materials.js +34 -0
  198. package/templates/create/3d-collectathon/src/runtime/state.js +27 -0
  199. package/templates/create/3d-collectathon/ui/hud.screen.js +66 -0
  200. package/templates/create/3d-collectathon/ui/pause.screen.js +13 -0
  201. package/templates/create/blank/config/gameplay/.gitkeep +1 -0
  202. package/templates/create/blank/content/gameplay/.gitkeep +1 -0
  203. package/templates/create/blank/content/registries/.gitkeep +1 -0
  204. package/templates/create/blank/docs/design/.gitkeep +1 -0
  205. package/templates/create/blank/docs/design/loop.md +5 -0
  206. package/templates/create/blank/prefabs/.gitkeep +1 -0
  207. package/templates/create/blank/scenes/.gitkeep +1 -0
  208. package/templates/create/blank/src/runtime/.gitkeep +1 -0
  209. package/templates/create/blank/ui/.gitkeep +1 -0
  210. package/templates/create/deckbuilder-2d/assets/audio/.gitkeep +1 -0
  211. package/templates/create/deckbuilder-2d/assets/fonts/.gitkeep +1 -0
  212. package/templates/create/deckbuilder-2d/assets/sprites/.gitkeep +1 -0
  213. package/templates/create/deckbuilder-2d/assets/starter/README.md +11 -0
  214. package/templates/create/deckbuilder-2d/assets/ui/.gitkeep +1 -0
  215. package/templates/create/deckbuilder-2d/aura.config.json +28 -0
  216. package/templates/create/deckbuilder-2d/config/gameplay/deckbuilder.config.js +26 -0
  217. package/templates/create/deckbuilder-2d/content/cards/guard.card.js +19 -0
  218. package/templates/create/deckbuilder-2d/content/cards/spark.card.js +20 -0
  219. package/templates/create/deckbuilder-2d/content/cards/starter.deck.js +69 -0
  220. package/templates/create/deckbuilder-2d/content/cards/strike.card.js +19 -0
  221. package/templates/create/deckbuilder-2d/content/cards/survey.card.js +20 -0
  222. package/templates/create/deckbuilder-2d/content/encounters/training-battle.encounter.js +14 -0
  223. package/templates/create/deckbuilder-2d/content/encounters/training-battle.js +65 -0
  224. package/templates/create/deckbuilder-2d/content/enemies/training-automaton.enemy.js +48 -0
  225. package/templates/create/deckbuilder-2d/content/gameplay/.gitkeep +1 -0
  226. package/templates/create/deckbuilder-2d/content/registries/cards.registry.js +26 -0
  227. package/templates/create/deckbuilder-2d/content/registries/encounters.registry.js +20 -0
  228. package/templates/create/deckbuilder-2d/content/registries/enemies.registry.js +20 -0
  229. package/templates/create/deckbuilder-2d/content/registries/relics.registry.js +20 -0
  230. package/templates/create/deckbuilder-2d/content/relics/ember-charm.relic.js +18 -0
  231. package/templates/create/deckbuilder-2d/docs/design/loop.md +12 -0
  232. package/templates/create/deckbuilder-2d/prefabs/.gitkeep +1 -0
  233. package/templates/create/deckbuilder-2d/scenes/boot.scene.js +84 -0
  234. package/templates/create/deckbuilder-2d/scenes/gameplay.scene.js +641 -0
  235. package/templates/create/deckbuilder-2d/src/components/.gitkeep +1 -0
  236. package/templates/create/deckbuilder-2d/src/main.js +17 -0
  237. package/templates/create/deckbuilder-2d/src/runtime/capabilities.js +22 -0
  238. package/templates/create/deckbuilder-2d/src/shared/.gitkeep +1 -0
  239. package/templates/create/deckbuilder-2d/src/systems/.gitkeep +1 -0
  240. package/templates/create/deckbuilder-2d/tests/smoke/.gitkeep +1 -0
  241. package/templates/create/deckbuilder-2d/ui/hud.screen.js +80 -0
  242. package/templates/create/deckbuilder-2d/ui/pause.screen.js +146 -0
  243. package/templates/create/deckbuilder-2d/ui/settings.screen.js +342 -0
  244. package/templates/create/local-multiplayer/aura.config.json +40 -0
  245. package/templates/create/local-multiplayer/config/gameplay/local-multiplayer.config.js +26 -0
  246. package/templates/create/local-multiplayer/content/gameplay/room-layout.js +13 -0
  247. package/templates/create/local-multiplayer/content/registries/.gitkeep +1 -0
  248. package/templates/create/local-multiplayer/docs/design/loop.md +14 -0
  249. package/templates/create/local-multiplayer/prefabs/player.prefab.js +99 -0
  250. package/templates/create/local-multiplayer/scenes/boot.scene.js +12 -0
  251. package/templates/create/local-multiplayer/scenes/gameplay.scene.js +443 -0
  252. package/templates/create/local-multiplayer/src/main.js +17 -0
  253. package/templates/create/local-multiplayer/src/runtime/capabilities.js +28 -0
  254. package/templates/create/local-multiplayer/ui/hud.screen.js +60 -0
  255. package/templates/create/shared/src/runtime/project-inspector.js +105 -0
  256. package/templates/create/shared/src/runtime/scene-flow.js +290 -0
  257. package/templates/create/shared/src/runtime/screen-shell.js +222 -0
  258. package/templates/create/shared/src/runtime/ui-forms.js +209 -0
  259. package/templates/create/shared/src/runtime/ui-settings.js +237 -0
  260. package/templates/create/shared/src/runtime/ui-theme.js +352 -0
  261. package/templates/create/shared/src/starter-utils/adventure-objectives.js +102 -0
  262. package/templates/create/shared/src/starter-utils/animation-2d.js +337 -0
  263. package/templates/create/shared/src/starter-utils/avatar-3d.js +404 -0
  264. package/templates/create/shared/src/starter-utils/combat-feedback-2d.js +320 -0
  265. package/templates/create/shared/src/starter-utils/core.js +39 -3
  266. package/templates/create/shared/src/starter-utils/index.js +8 -2
  267. package/templates/create/shared/src/starter-utils/platformer-3d.js +34 -3
  268. package/templates/create/shared/src/starter-utils/triggers.js +662 -0
  269. package/templates/create/shared/src/starter-utils/tween-2d.js +615 -0
  270. package/templates/create/video-cutscene/assets/video/.gitkeep +0 -0
  271. package/templates/create/video-cutscene/aura.config.json +28 -0
  272. package/templates/create/video-cutscene/config/gameplay/.gitkeep +0 -0
  273. package/templates/create/video-cutscene/content/gameplay/.gitkeep +0 -0
  274. package/templates/create/video-cutscene/content/registries/.gitkeep +0 -0
  275. package/templates/create/video-cutscene/docs/design/loop.md +22 -0
  276. package/templates/create/video-cutscene/prefabs/.gitkeep +0 -0
  277. package/templates/create/video-cutscene/scenes/boot.scene.js +11 -0
  278. package/templates/create/video-cutscene/scenes/cutscene.scene.js +113 -0
  279. package/templates/create/video-cutscene/scenes/gameplay.scene.js +50 -0
  280. package/templates/create/video-cutscene/src/main.js +17 -0
  281. package/templates/create/video-cutscene/src/runtime/app.js +52 -0
  282. package/templates/create/video-cutscene/src/runtime/capabilities.js +35 -0
  283. package/templates/create/video-cutscene/src/runtime/state.js +13 -0
  284. package/templates/create/video-cutscene/ui/.gitkeep +0 -0
  285. package/templates/create-bin/play.js +1187 -0
  286. package/templates/make/README.md +46 -0
  287. package/templates/make/catalog.json +51 -0
  288. package/templates/make/component/files/{{MAKE_NAME}}.component.js +20 -0
  289. package/templates/make/component/manifest.json +9 -0
  290. package/templates/make/data/files/{{MAKE_NAME}}.json +14 -0
  291. package/templates/make/data/manifest.json +9 -0
  292. package/templates/make/material/files/{{MAKE_NAME}}.material.json +17 -0
  293. package/templates/make/material/manifest.json +9 -0
  294. package/templates/make/prefab/files/{{MAKE_NAME}}.prefab.js +20 -0
  295. package/templates/make/prefab/manifest.json +9 -0
  296. package/templates/make/scene/files/{{MAKE_NAME}}.scene.js +31 -0
  297. package/templates/make/scene/manifest.json +9 -0
  298. package/templates/make/shader/files/{{MAKE_NAME}}.shader.js +23 -0
  299. package/templates/make/shader/manifest.json +9 -0
  300. package/templates/make/system/files/{{MAKE_NAME}}.system.js +15 -0
  301. package/templates/make/system/manifest.json +9 -0
  302. package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.js +16 -0
  303. package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.json +23 -0
  304. package/templates/make/ui-screen/manifest.json +10 -0
  305. package/templates/make-starters/deckbuilder-2d/card/files/{{MAKE_NAME}}.card.js +22 -0
  306. package/templates/make-starters/deckbuilder-2d/card/manifest.json +9 -0
  307. package/templates/make-starters/deckbuilder-2d/catalog.json +34 -0
  308. package/templates/make-starters/deckbuilder-2d/encounter/files/{{MAKE_NAME}}.encounter.js +18 -0
  309. package/templates/make-starters/deckbuilder-2d/encounter/manifest.json +9 -0
  310. package/templates/make-starters/deckbuilder-2d/enemy/files/{{MAKE_NAME}}.enemy.js +28 -0
  311. package/templates/make-starters/deckbuilder-2d/enemy/manifest.json +9 -0
  312. package/templates/make-starters/deckbuilder-2d/relic/files/{{MAKE_NAME}}.relic.js +23 -0
  313. package/templates/make-starters/deckbuilder-2d/relic/manifest.json +9 -0
  314. package/templates/retro/platformer/README.md +10 -0
  315. package/templates/retro/platformer/assets/retro/assets.json +91 -0
  316. package/templates/retro/platformer/aura.config.json +7 -0
  317. package/templates/retro/platformer/package.json +5 -0
  318. package/templates/retro/platformer/src/main.js +40 -0
  319. package/templates/retro/puzzle-grid/README.md +10 -0
  320. package/templates/retro/puzzle-grid/assets/retro/assets.json +90 -0
  321. package/templates/retro/puzzle-grid/aura.config.json +7 -0
  322. package/templates/retro/puzzle-grid/package.json +5 -0
  323. package/templates/retro/puzzle-grid/src/main.js +29 -0
  324. package/templates/retro/tactics-grid/README.md +10 -0
  325. package/templates/retro/tactics-grid/assets/retro/assets.json +90 -0
  326. package/templates/retro/tactics-grid/aura.config.json +7 -0
  327. package/templates/retro/tactics-grid/package.json +5 -0
  328. package/templates/retro/tactics-grid/src/main.js +35 -0
  329. package/templates/retro/topdown-adventure/README.md +10 -0
  330. package/templates/retro/topdown-adventure/assets/retro/assets.json +95 -0
  331. package/templates/retro/topdown-adventure/aura.config.json +7 -0
  332. package/templates/retro/topdown-adventure/package.json +5 -0
  333. package/templates/retro/topdown-adventure/src/main.js +29 -0
  334. package/templates/skills/aurajs/SKILL.md +61 -5
@@ -0,0 +1,184 @@
1
+ {
2
+ "asset": {
3
+ "version": "2.0"
4
+ },
5
+ "buffers": [
6
+ {
7
+ "byteLength": 876,
8
+ "uri": "data:application/octet-stream;base64,AAAAvwAAAAAAAAC/AAAAPwAAAAAAAAC/AAAAPwAAgD8AAAC/AAAAvwAAgD8AAAC/AAAAvwAAAAAAAAA/AAAAPwAAAAAAAAA/AAAAPwAAgD8AAAA/AAAAvwAAgD8AAAA/AAABAAIAAAACAAMABAAGAAUABAAHAAYAAAAEAAUAAAAFAAEAAwACAAYAAwAGAAcAAQAFAAYAAQAGAAIAAAADAAcAAAAHAAQAAAAAAAAAAAAAAAAAAAAAAM3MTD0AAAAAAAAAAAAAAAAAAAAAAAAAAM3MrD8AAAAAAAAAAIXrsT8AAAAAAAAAAM3MrD8AAAAAAAAAAGZm5j5mZmY/AAAAAAAAAAAAAAAAAAAAAI/CdT0AAAAAAAAAAAAAAAAAAAAAPQrXvuxROD8K16M9PQrXvnsULj8K16O9PQrXvuxROD8K16M9PQrXPuxROD8K16O9PQrXPnsULj8K16M9PQrXPuxROD8K16O9KVwPvuxROD4K16O9KVwPvilcDz4K16M9KVwPvuxROD4K16O9KVwPPuxROD4K16M9KVwPPilcDz4K16O9KVwPPuxROD4K16M9AAAAAM3MzD7NzEw/AAAAAAAAAAAAAAAAAAAAAM3MzD0AAAAAAAAAAAAAAAAAAAAAPQrXvqRwPT8pXA8+PQrXvlK4Hj8pXA++PQrXvqRwPT8pXA8+PQrXPqRwPT8pXA++PQrXPlK4Hj8pXA8+PQrXPqRwPT8pXA++KVwPvq5HYT4pXA++KVwPvgrXoz0pXA8+KVwPvq5HYT4pXA++KVwPPq5HYT4pXA8+KVwPPgrXoz0pXA++KVwPPq5HYT4pXA8+AAAAAJqZmT6amRk/AAAAAAAAAAAAAAAAAAAAAI/CdT6PwnU9AAAAAArXIz2PwvU9PQrXvuxROD8K16M8PQrXvoXrUT8K16M9PQrXvhSuRz8K1yM9PQrXPuxROD8K16O8PQrXPoXrUT8K16O9PQrXPhSuRz8K1yO9AAAAADMzsz4zMzM/AAAAAArXoz2PwvU9AAAAAI/Cdb0K16M8AAAAAI/C9b0K16O9PQrXvlyPQj8K1yM9PQrXvjMzMz8K16M8PQrXvsP1KD8AAAAAPQrXPlyPQj8K1yO9PQrXPjMzMz8K16O8PQrXPsP1KD8AAAAAAAAAAAAAgD4AAAA/"
9
+ }
10
+ ],
11
+ "bufferViews": [
12
+ { "buffer": 0, "byteOffset": 0, "byteLength": 96 },
13
+ { "buffer": 0, "byteOffset": 96, "byteLength": 72 },
14
+ { "buffer": 0, "byteOffset": 168, "byteLength": 36 },
15
+ { "buffer": 0, "byteOffset": 204, "byteLength": 36 },
16
+ { "buffer": 0, "byteOffset": 240, "byteLength": 12 },
17
+ { "buffer": 0, "byteOffset": 252, "byteLength": 36 },
18
+ { "buffer": 0, "byteOffset": 288, "byteLength": 36 },
19
+ { "buffer": 0, "byteOffset": 324, "byteLength": 36 },
20
+ { "buffer": 0, "byteOffset": 360, "byteLength": 36 },
21
+ { "buffer": 0, "byteOffset": 396, "byteLength": 36 },
22
+ { "buffer": 0, "byteOffset": 432, "byteLength": 12 },
23
+ { "buffer": 0, "byteOffset": 444, "byteLength": 36 },
24
+ { "buffer": 0, "byteOffset": 480, "byteLength": 36 },
25
+ { "buffer": 0, "byteOffset": 516, "byteLength": 36 },
26
+ { "buffer": 0, "byteOffset": 552, "byteLength": 36 },
27
+ { "buffer": 0, "byteOffset": 588, "byteLength": 36 },
28
+ { "buffer": 0, "byteOffset": 624, "byteLength": 12 },
29
+ { "buffer": 0, "byteOffset": 636, "byteLength": 36 },
30
+ { "buffer": 0, "byteOffset": 672, "byteLength": 36 },
31
+ { "buffer": 0, "byteOffset": 708, "byteLength": 36 },
32
+ { "buffer": 0, "byteOffset": 744, "byteLength": 12 },
33
+ { "buffer": 0, "byteOffset": 756, "byteLength": 36 },
34
+ { "buffer": 0, "byteOffset": 792, "byteLength": 36 },
35
+ { "buffer": 0, "byteOffset": 828, "byteLength": 36 },
36
+ { "buffer": 0, "byteOffset": 864, "byteLength": 12 }
37
+ ],
38
+ "accessors": [
39
+ { "bufferView": 0, "byteOffset": 0, "componentType": 5126, "count": 8, "type": "VEC3" },
40
+ { "bufferView": 1, "byteOffset": 0, "componentType": 5123, "count": 36, "type": "SCALAR" },
41
+ { "bufferView": 2, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
42
+ { "bufferView": 3, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
43
+ { "bufferView": 4, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
44
+ { "bufferView": 5, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
45
+ { "bufferView": 6, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
46
+ { "bufferView": 7, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
47
+ { "bufferView": 8, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
48
+ { "bufferView": 9, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
49
+ { "bufferView": 10, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
50
+ { "bufferView": 11, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
51
+ { "bufferView": 12, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
52
+ { "bufferView": 13, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
53
+ { "bufferView": 14, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
54
+ { "bufferView": 15, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
55
+ { "bufferView": 16, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
56
+ { "bufferView": 17, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
57
+ { "bufferView": 18, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
58
+ { "bufferView": 19, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
59
+ { "bufferView": 20, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
60
+ { "bufferView": 21, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
61
+ { "bufferView": 22, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
62
+ { "bufferView": 23, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
63
+ { "bufferView": 24, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" }
64
+ ],
65
+ "materials": [
66
+ {
67
+ "name": "Body",
68
+ "pbrMetallicRoughness": {
69
+ "baseColorFactor": [0.86, 0.63, 0.4, 1],
70
+ "metallicFactor": 0.04,
71
+ "roughnessFactor": 0.88
72
+ }
73
+ },
74
+ {
75
+ "name": "Accent",
76
+ "pbrMetallicRoughness": {
77
+ "baseColorFactor": [0.15, 0.68, 0.88, 1],
78
+ "metallicFactor": 0.08,
79
+ "roughnessFactor": 0.62
80
+ }
81
+ }
82
+ ],
83
+ "meshes": [
84
+ {
85
+ "name": "BodyCube",
86
+ "primitives": [
87
+ { "attributes": { "POSITION": 0 }, "indices": 1, "material": 0 }
88
+ ]
89
+ },
90
+ {
91
+ "name": "AccentCube",
92
+ "primitives": [
93
+ { "attributes": { "POSITION": 0 }, "indices": 1, "material": 1 }
94
+ ]
95
+ }
96
+ ],
97
+ "nodes": [
98
+ { "name": "Root", "children": [1] },
99
+ { "name": "AvatarRig", "children": [2, 3, 4, 5, 6, 7] },
100
+ { "name": "Torso", "mesh": 0, "translation": [0, 0.65, 0], "scale": [0.38, 0.6, 0.22] },
101
+ { "name": "Head", "mesh": 1, "translation": [0, 1.35, 0], "scale": [0.28, 0.28, 0.28] },
102
+ { "name": "ArmL", "mesh": 1, "translation": [-0.42, 0.72, 0], "scale": [0.12, 0.46, 0.12] },
103
+ { "name": "ArmR", "mesh": 1, "translation": [0.42, 0.72, 0], "scale": [0.12, 0.46, 0.12] },
104
+ { "name": "LegL", "mesh": 0, "translation": [-0.14, 0.18, 0], "scale": [0.14, 0.36, 0.14] },
105
+ { "name": "LegR", "mesh": 0, "translation": [0.14, 0.18, 0], "scale": [0.14, 0.36, 0.14] }
106
+ ],
107
+ "scenes": [
108
+ { "nodes": [0] }
109
+ ],
110
+ "scene": 0,
111
+ "animations": [
112
+ {
113
+ "name": "Idle",
114
+ "channels": [
115
+ { "sampler": 0, "target": { "node": 1, "path": "translation" } },
116
+ { "sampler": 1, "target": { "node": 3, "path": "translation" } }
117
+ ],
118
+ "samplers": [
119
+ { "input": 4, "output": 2, "interpolation": "LINEAR" },
120
+ { "input": 4, "output": 3, "interpolation": "LINEAR" }
121
+ ]
122
+ },
123
+ {
124
+ "name": "Walk",
125
+ "channels": [
126
+ { "sampler": 0, "target": { "node": 1, "path": "translation" } },
127
+ { "sampler": 1, "target": { "node": 4, "path": "translation" } },
128
+ { "sampler": 2, "target": { "node": 5, "path": "translation" } },
129
+ { "sampler": 3, "target": { "node": 6, "path": "translation" } },
130
+ { "sampler": 4, "target": { "node": 7, "path": "translation" } }
131
+ ],
132
+ "samplers": [
133
+ { "input": 10, "output": 5, "interpolation": "LINEAR" },
134
+ { "input": 10, "output": 6, "interpolation": "LINEAR" },
135
+ { "input": 10, "output": 7, "interpolation": "LINEAR" },
136
+ { "input": 10, "output": 8, "interpolation": "LINEAR" },
137
+ { "input": 10, "output": 9, "interpolation": "LINEAR" }
138
+ ]
139
+ },
140
+ {
141
+ "name": "Run",
142
+ "channels": [
143
+ { "sampler": 0, "target": { "node": 1, "path": "translation" } },
144
+ { "sampler": 1, "target": { "node": 4, "path": "translation" } },
145
+ { "sampler": 2, "target": { "node": 5, "path": "translation" } },
146
+ { "sampler": 3, "target": { "node": 6, "path": "translation" } },
147
+ { "sampler": 4, "target": { "node": 7, "path": "translation" } }
148
+ ],
149
+ "samplers": [
150
+ { "input": 16, "output": 11, "interpolation": "LINEAR" },
151
+ { "input": 16, "output": 12, "interpolation": "LINEAR" },
152
+ { "input": 16, "output": 13, "interpolation": "LINEAR" },
153
+ { "input": 16, "output": 14, "interpolation": "LINEAR" },
154
+ { "input": 16, "output": 15, "interpolation": "LINEAR" }
155
+ ]
156
+ },
157
+ {
158
+ "name": "Jump",
159
+ "channels": [
160
+ { "sampler": 0, "target": { "node": 1, "path": "translation" } },
161
+ { "sampler": 1, "target": { "node": 4, "path": "translation" } },
162
+ { "sampler": 2, "target": { "node": 5, "path": "translation" } }
163
+ ],
164
+ "samplers": [
165
+ { "input": 20, "output": 17, "interpolation": "LINEAR" },
166
+ { "input": 20, "output": 18, "interpolation": "LINEAR" },
167
+ { "input": 20, "output": 19, "interpolation": "LINEAR" }
168
+ ]
169
+ },
170
+ {
171
+ "name": "Fall",
172
+ "channels": [
173
+ { "sampler": 0, "target": { "node": 1, "path": "translation" } },
174
+ { "sampler": 1, "target": { "node": 4, "path": "translation" } },
175
+ { "sampler": 2, "target": { "node": 5, "path": "translation" } }
176
+ ],
177
+ "samplers": [
178
+ { "input": 24, "output": 21, "interpolation": "LINEAR" },
179
+ { "input": 24, "output": 22, "interpolation": "LINEAR" },
180
+ { "input": 24, "output": 23, "interpolation": "LINEAR" }
181
+ ]
182
+ }
183
+ ]
184
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "schema": "aurajs.collectibles.v1",
3
+ "collectibles": [
4
+ {
5
+ "id": "orb-a",
6
+ "x": -2.8,
7
+ "y": 1.8,
8
+ "z": 2.2,
9
+ "value": 1
10
+ },
11
+ {
12
+ "id": "orb-b",
13
+ "x": 2.4,
14
+ "y": 2.4,
15
+ "z": 0.4,
16
+ "value": 1
17
+ },
18
+ {
19
+ "id": "orb-c",
20
+ "x": 4.6,
21
+ "y": 3.8,
22
+ "z": -2.8,
23
+ "value": 1
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,46 @@
1
+ export const PLAYER_HALF = { x: 0.45, y: 0.55, z: 0.45 };
2
+ export const MOVE_SPEED = 5.6;
3
+ export const JUMP_SPEED = 8.4;
4
+ export const GRAVITY = 20.0;
5
+ export const WORLD_LIMIT = 9.2;
6
+ export const TARGET_COLLECTIBLES = 5;
7
+ export const START_TIMER_SECONDS = 95;
8
+
9
+ export const FLOOR_SCALE = { x: 26, y: 1, z: 26 };
10
+ export const PLAYER_SPAWN = { x: 0, y: 1.1, z: 5.8 };
11
+ export const CAMERA_OFFSET = { x: 7.8, y: 6.2, z: 8.5 };
12
+ export const CAMERA_LOOK_OFFSET = { x: 0, y: 0.2, z: 0 };
13
+
14
+ export const WORLD_PLATFORMS = [
15
+ { x: -3.2, y: 1.2, z: 2.6, sx: 3.0, sy: 0.5, sz: 2.3 },
16
+ { x: 2.5, y: 2.2, z: 1.2, sx: 2.8, sy: 0.5, sz: 2.1 },
17
+ { x: 4.9, y: 3.3, z: -1.8, sx: 2.8, sy: 0.5, sz: 2.0 },
18
+ { x: -1.0, y: 3.7, z: -3.3, sx: 3.0, sy: 0.5, sz: 2.2 },
19
+ { x: 3.8, y: 4.8, z: -5.1, sx: 2.8, sy: 0.5, sz: 2.0 },
20
+ ];
21
+
22
+ export const CHECKPOINTS = [
23
+ { x: 0.0, y: 1.1, z: 5.8, radius: 1.4 },
24
+ { x: -3.2, y: 2.0, z: 2.6, radius: 1.2 },
25
+ { x: 2.5, y: 3.0, z: 1.2, radius: 1.2 },
26
+ { x: -1.0, y: 4.5, z: -3.3, radius: 1.25 },
27
+ { x: 3.8, y: 5.7, z: -5.1, radius: 1.3 },
28
+ ];
29
+
30
+ export const COLLECTIBLE_SPAWNS = [
31
+ { x: -3.2, y: 2.0, z: 2.6 },
32
+ { x: 2.5, y: 3.0, z: 1.2 },
33
+ { x: 4.9, y: 4.1, z: -1.8 },
34
+ { x: -1.0, y: 4.5, z: -3.3 },
35
+ { x: 3.8, y: 5.7, z: -5.1 },
36
+ { x: 0.2, y: 2.8, z: -0.8 },
37
+ ];
38
+
39
+ export const MOVING_PLATFORM = {
40
+ from: { x: 0.7, y: 2.1, z: -0.5 },
41
+ to: { x: 3.2, y: 3.1, z: -2.1 },
42
+ size: { x: 2.2, y: 0.4, z: 1.8 },
43
+ periodSeconds: 3.0,
44
+ };
45
+
46
+ export const GOAL_ZONE = { x: 3.8, y: 5.9, z: -5.1, radius: 1.15 };
@@ -0,0 +1,5 @@
1
+ # 3D Collectathon Loop
2
+
3
+ 1. Traverse the route, gather the collectible set, and clear the course.
4
+ 1. Keep authored route nouns in `content/gameplay/course.js`, collectible placement in `content/gameplay/collectibles.json`, and reusable presentation pieces in `prefabs/`.
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 collectiblePrefab = {
2
+ id: 'collectible',
3
+ kind: 'prefab',
4
+ role: 'pickup',
5
+ view: { kind: 'pickup3d' },
6
+ components: {},
7
+ hooks: {},
8
+ notes: ['Keep collection VFX and reward payload shape here.'],
9
+ };
10
+
11
+ export function createCollectiblePrefab() {
12
+ return collectiblePrefab;
13
+ }
14
+
15
+ export default collectiblePrefab;
@@ -0,0 +1,207 @@
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 collectathon loop starts from an imported character.'],
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-collectathon-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-collectathon-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 drawCollectathonActors({ mesh, materials, state, goalZone }) {
170
+ for (const collectible of state.collectibles) {
171
+ if (collectible.collected) continue;
172
+ aura.draw3d.drawMesh(mesh, materials.collectible, {
173
+ position: {
174
+ x: collectible.x,
175
+ y: collectible.y + (Math.sin((state.elapsed * 2.2) + collectible.x) * 0.16),
176
+ z: collectible.z,
177
+ },
178
+ rotation: {
179
+ x: state.elapsed * 0.5,
180
+ y: state.elapsed * 1.7,
181
+ z: state.elapsed * 0.3,
182
+ },
183
+ scale: { x: 0.45, y: 0.45, z: 0.45 },
184
+ });
185
+ }
186
+
187
+ const checkpoint = activeCheckpoint(state.checkpointSystem);
188
+ if (checkpoint) {
189
+ aura.draw3d.drawMesh(mesh, materials.checkpoint, {
190
+ position: { x: checkpoint.x, y: checkpoint.y - 0.35, z: checkpoint.z },
191
+ rotation: { x: 0, y: state.elapsed, z: 0 },
192
+ scale: { x: 0.4, y: 0.4, z: 0.4 },
193
+ });
194
+ }
195
+
196
+ aura.draw3d.drawMesh(mesh, materials.goal, {
197
+ position: { x: goalZone.x, y: goalZone.y, z: goalZone.z },
198
+ rotation: { x: 0, y: state.elapsed * 0.9, z: 0 },
199
+ scale: {
200
+ x: goalZone.radius * 1.25,
201
+ y: goalZone.radius * 1.25,
202
+ z: goalZone.radius * 1.25,
203
+ },
204
+ });
205
+ }
206
+
207
+ export default playerPrefab;
@@ -0,0 +1,112 @@
1
+ import { FLOOR_SCALE, WORLD_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 world descriptor before you move to richer scene data.'],
12
+ };
13
+
14
+ export function createWorldPrefab() {
15
+ return {
16
+ ...worldPrefab,
17
+ platformCount: WORLD_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 WORLD_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 syncCollectathonCharacterObstacles(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 WORLD_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 drawCollectathonCourse({ 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 WORLD_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: movingPlatform.t * 0.5, 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-collectathon',
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
+ }
@@ -0,0 +1,9 @@
1
+ export function createCheckpointScene() {
2
+ return {
3
+ id: "checkpoint",
4
+ nextSceneId: "gameplay",
5
+ notes: [
6
+ "Use this for checkpoint route previews, timers, or recovery beats."
7
+ ],
8
+ };
9
+ }