incanto 0.71.0 → 0.73.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 (92) hide show
  1. package/bin/incanto-check.mjs +114 -42
  2. package/bin/incanto-editor.mjs +15 -9
  3. package/bin/incanto-feel.mjs +11 -1
  4. package/bin/incanto-play.mjs +11 -1
  5. package/bin/incanto-playtest.mjs +11 -1
  6. package/bin/incanto-verify.mjs +9 -2
  7. package/dist/2d.d.ts +29 -4
  8. package/dist/2d.js +3 -3
  9. package/dist/3d.d.ts +137 -15
  10. package/dist/3d.js +6 -6
  11. package/dist/{agent8-Cfmd3ar_.js → agent8-CHTT4unP.js} +1 -1
  12. package/dist/{audio-player-L8yccdMP.d.ts → audio-player-BOrk4eQx.d.ts} +1 -1
  13. package/dist/{behavior-Dcz0fr1S.d.ts → behavior-J1cmVah0.d.ts} +9 -1
  14. package/dist/{create-game-LCHBLfA4.js → create-game-CAu-ucHg.js} +8 -7
  15. package/dist/{create-game-CH4kt78v.js → create-game-CbTLFjis.js} +37 -13
  16. package/dist/debug.d.ts +1 -1
  17. package/dist/debug.js +1 -1
  18. package/dist/editor.js +1036 -930
  19. package/dist/{environment-presets-99BzP_L-.js → environment-presets-BsFJM3v0.js} +277 -60
  20. package/dist/{gameplay-CNULJvwh.js → gameplay-CRte0OVf.js} +589 -35
  21. package/dist/gameplay.d.ts +136 -4
  22. package/dist/gameplay.js +2 -2
  23. package/dist/index.d.ts +6 -4
  24. package/dist/index.js +6 -6
  25. package/dist/{loader-8-IHvbKD.d.ts → loader-BAeWMYfF.d.ts} +10 -3
  26. package/dist/net.d.ts +2 -2
  27. package/dist/net.js +2 -2
  28. package/dist/{physics-2d-FhrXUc6B.js → physics-2d-CovokK7s.js} +94 -11
  29. package/dist/{physics-3d-CFEGxBXZ.js → physics-3d-BiK6Emwn.js} +202 -15
  30. package/dist/{picking-DVo7fI13.js → picking-Dtd8JInh.js} +2 -2
  31. package/dist/react.d.ts +1 -1
  32. package/dist/react.js +1 -1
  33. package/dist/{register-BYQCBySi.js → register-CY9QCCZs.js} +45 -9
  34. package/dist/{register-DuVdzxbq.js → register-CjociOtt.js} +19 -4
  35. package/dist/{replay-DEvp3kyV.js → replay-B6BbgGM_.js} +55 -12
  36. package/dist/{replay-F7IZHdFR.d.ts → replay-wZK5Ok5c.d.ts} +2 -2
  37. package/dist/{save-slots-Bvuh2p_r.js → save-slots-CEUGeLuB.js} +57 -3
  38. package/dist/{split-screen-eULetcg-.js → split-screen-BxZ5rBe7.js} +4 -4
  39. package/dist/{split-screen-CIYf1zSf.d.ts → split-screen-D6sx8z3Z.d.ts} +2 -2
  40. package/dist/{sprite-animation-CqR2o3SA.js → sprite-animation-Bz3DHD_4.js} +1 -1
  41. package/dist/{src-_jk0qLsS.js → src-D-dnVrFY.js} +1 -1
  42. package/dist/{test-CmN54kWv.js → test-DZmCFz0Q.js} +162 -30
  43. package/dist/test.d.ts +56 -5
  44. package/dist/test.js +2 -2
  45. package/dist/{touch-BnCyPA0G.js → touch-CioTZB-y.js} +1 -1
  46. package/dist/vite.d.ts +8 -1
  47. package/dist/vite.js +22 -5
  48. package/editor/assets/{agent8-yLIEYHbd.js → agent8-GuZ5u5bi.js} +1 -1
  49. package/editor/assets/{debug-u31w_yhq.js → debug-BbxionO2.js} +1 -1
  50. package/editor/assets/{index-DK9xMGpW.js → index-CNlTzQbm.js} +92 -92
  51. package/editor/index.html +1 -1
  52. package/package.json +1 -1
  53. package/schemas/scene.schema.json +634 -10
  54. package/skills/incanto-3d-character.md +113 -5
  55. package/skills/incanto-assets.md +9 -3
  56. package/skills/incanto-behaviors-and-scripts.md +26 -2
  57. package/skills/incanto-building-2d-games.md +15 -0
  58. package/skills/incanto-building-3d-games.md +45 -0
  59. package/skills/incanto-editor.md +10 -1
  60. package/skills/incanto-environment.md +7 -2
  61. package/skills/incanto-game-feel.md +16 -11
  62. package/skills/incanto-gameplay-behaviors.md +174 -15
  63. package/skills/incanto-node-reference.md +122 -45
  64. package/skills/incanto-physics-and-input.md +67 -5
  65. package/skills/incanto-scene-json-authoring.md +37 -1
  66. package/skills/incanto-verifying-your-game.md +19 -2
  67. package/templates-app/beacon-isle-3d/PROJECT/Status.md +8 -0
  68. package/templates-app/beacon-isle-3d/PROJECT/Structure.md +3 -0
  69. package/templates-app/beacon-isle-3d/package.json +1 -1
  70. package/templates-app/beacon-isle-3d/src/game.scene.json +512 -184
  71. package/templates-app/beacon-isle-3d/verify.ts +144 -0
  72. package/templates-app/molehill-2d/package.json +1 -1
  73. package/templates-app/platformer-2d/PROJECT/Status.md +7 -0
  74. package/templates-app/platformer-2d/PROJECT/Structure.md +3 -0
  75. package/templates-app/platformer-2d/package.json +1 -1
  76. package/templates-app/platformer-2d/src/game.scene.json +319 -93
  77. package/templates-app/platformer-2d/verify.ts +54 -0
  78. package/templates-app/star-survivor/package.json +1 -1
  79. package/templates-app/star-survivor/src/game.scene.json +18 -9
  80. package/templates-app/tps-3d/PROJECT/Context.md +1 -1
  81. package/templates-app/tps-3d/PROJECT/Status.md +40 -1
  82. package/templates-app/tps-3d/PROJECT/Structure.md +19 -0
  83. package/templates-app/tps-3d/package.json +1 -1
  84. package/templates-app/tps-3d/src/behaviors.ts +9 -0
  85. package/templates-app/tps-3d/src/cover.scene.json +26 -0
  86. package/templates-app/tps-3d/src/game.scene.json +379 -80
  87. package/templates-app/tps-3d/src/main.ts +14 -0
  88. package/templates-app/tps-3d/src/pillar.scene.json +25 -0
  89. package/templates-app/tps-3d/verify.ts +582 -3
  90. package/templates-app/village-quest-3d/package.json +1 -1
  91. package/templates-app/village-quest-3d/src/grove.scene.json +98 -46
  92. package/templates-app/village-quest-3d/src/village.scene.json +449 -223
@@ -13,6 +13,8 @@
13
13
  * `Shoot` (the click-to-fire hitscan + face-aim) and `HudUpdater` (the HUD +
14
14
  * win/lose banner).
15
15
  */
16
+
17
+ import type { SceneJson } from 'incanto';
16
18
  import { assetUrls, preloadUrls } from 'incanto';
17
19
  import { createGame3D, showBootFailure } from 'incanto/3d';
18
20
  // A bundled clip looped as low ambience (no large music files ship in the
@@ -21,6 +23,17 @@ import musicUrl from 'incanto/assets/audio/spells_cast.mp3';
21
23
  import { HudUpdater, Shoot } from './behaviors';
22
24
  import sceneJson from './game.scene.json';
23
25
 
26
+ /**
27
+ * The sub-scenes this scene `instance:`s — `cover.scene.json` and
28
+ * `pillar.scene.json` — handed to the loader by path. `loadScene` never reads
29
+ * files; vite's `import.meta.glob` gathers every scene beside this one.
30
+ */
31
+ const prefabs = import.meta.glob('./*.scene.json', {
32
+ eager: true,
33
+ import: 'default',
34
+ }) as Record<string, SceneJson>;
35
+ const resolveScene = (path: string): SceneJson | null => prefabs[`./${path}`] ?? null;
36
+
24
37
  // The soldier is a real GLB character (base-model.glb) animated by mixamo clips
25
38
  // (idle/walk/run/jump) — declared in the scene `assets`. Warm the HTTP cache with
26
39
  // a progress bar before booting; the arena, enemies, SFX + music stay zero-fetch.
@@ -50,6 +63,7 @@ const game = await createGame3D({
50
63
  editor: DEBUG && { library: true },
51
64
  canvas,
52
65
  scene: sceneJson,
66
+ resolveScene,
53
67
  behaviors: { Shoot, HudUpdater },
54
68
  pointer: true, // pointer-lock mouse look (lockOnClick) — drives the free-view yaw/pitch
55
69
  }).catch((e) => {
@@ -0,0 +1,25 @@
1
+ {
2
+ "format": 1,
3
+ "type": "scene",
4
+ "dimension": "3d",
5
+ "name": "Pillar",
6
+ "root": {
7
+ "name": "Pillar",
8
+ "type": "StaticBody3D",
9
+ "props": { "collider": { "shape": "box", "size": [1.1, 4, 1.1] } },
10
+ "children": [
11
+ {
12
+ "name": "Skin",
13
+ "type": "MeshInstance3D",
14
+ "props": {
15
+ "mesh": "box",
16
+ "size": [1.1, 4, 1.1],
17
+ "material": { "color": "#454f61", "roughness": 0.95 },
18
+ "castShadow": true
19
+ },
20
+ "uid": "n_lfda1tis5dtjjebu"
21
+ }
22
+ ],
23
+ "uid": "n_k1evvnmzx0j4bzpq"
24
+ }
25
+ }