incanto 0.12.0 → 0.13.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 (82) hide show
  1. package/README.md +22 -0
  2. package/bin/incanto-new.mjs +87 -0
  3. package/dist/2d.d.ts +2 -2
  4. package/dist/2d.js +3 -3
  5. package/dist/3d.d.ts +194 -71
  6. package/dist/3d.js +74 -4
  7. package/dist/{behavior-Bod1AyJS.d.ts → behavior-CPibUfnH.d.ts} +4 -2
  8. package/dist/{create-game-C_xf4gm9.js → create-game-Ct86zczq.js} +5 -5
  9. package/dist/{create-game-B2fewJUy.js → create-game-J6g4QInv.js} +5 -5
  10. package/dist/debug.d.ts +1 -1
  11. package/dist/{duplicate-BEvGBtb_.js → duplicate-BINwP0WG.js} +1 -1
  12. package/dist/{gameplay-Dn3yidJw.js → gameplay-sSqrUcnz.js} +75 -3
  13. package/dist/gameplay.d.ts +37 -2
  14. package/dist/gameplay.js +2 -2
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +4 -4
  17. package/dist/{loader-B4OEXDZ8.js → loader-BZqOKfI2.js} +3 -1
  18. package/dist/{loader-BcUDfNHn.d.ts → loader-DILt9PGC.d.ts} +1 -1
  19. package/dist/net.d.ts +1 -1
  20. package/dist/net.js +3 -3
  21. package/dist/{pathfinding-BSiXjd6W.d.ts → pathfinding-RWYkNKx9.d.ts} +1 -1
  22. package/dist/{physics-2d-B6D864oZ.js → physics-2d-BiIdl51r.js} +2 -2
  23. package/dist/{physics-3d-RLNaxRyw.js → physics-3d-DhaAaKJo.js} +2 -2
  24. package/dist/react.d.ts +1 -1
  25. package/dist/react.js +1 -1
  26. package/dist/{register-Cwc-yCYx.js → register-BFFE1Mh1.js} +2 -2
  27. package/dist/{register-ysLR3WQS.js → register-BFw4c83z.js} +508 -123
  28. package/dist/{register-BD6zgrv_.js → register-Djwckzgx.js} +2 -2
  29. package/dist/{register-DJZXxwAn.js → register-nObreUQR.js} +1 -1
  30. package/dist/test.d.ts +2 -2
  31. package/dist/test.js +10 -10
  32. package/editor/assets/{agent8-D_4QY8Aq.js → agent8-BF8Jfbkl.js} +1 -1
  33. package/editor/assets/{index-s0DZuroe.js → index-DSq0gdhE.js} +74 -74
  34. package/editor/index.html +1 -1
  35. package/package.json +4 -2
  36. package/schemas/scene.schema.json +263 -0
  37. package/skills/incanto-3d-character.md +35 -0
  38. package/skills/incanto-building-3d-games.md +48 -0
  39. package/skills/incanto-gameplay-behaviors.md +23 -1
  40. package/skills/incanto-node-reference.md +51 -0
  41. package/templates-app/beacon-isle-3d/PROJECT/Context.md +44 -0
  42. package/templates-app/beacon-isle-3d/PROJECT/Requirements.md +16 -0
  43. package/templates-app/beacon-isle-3d/PROJECT/Status.md +38 -0
  44. package/templates-app/beacon-isle-3d/PROJECT/Structure.md +24 -0
  45. package/templates-app/beacon-isle-3d/docs/project-3d-rules.md +38 -0
  46. package/templates-app/beacon-isle-3d/generate-world.ts +814 -0
  47. package/templates-app/beacon-isle-3d/index.html +68 -0
  48. package/templates-app/beacon-isle-3d/package.json +26 -0
  49. package/templates-app/beacon-isle-3d/src/behaviors.ts +570 -0
  50. package/templates-app/beacon-isle-3d/src/game.scene.json +2992 -0
  51. package/templates-app/beacon-isle-3d/src/main.ts +33 -0
  52. package/templates-app/beacon-isle-3d/tsconfig.json +13 -0
  53. package/templates-app/beacon-isle-3d/verify.ts +285 -0
  54. package/templates-app/beacon-isle-3d/vite.config.ts +5 -0
  55. package/templates-app/tps-3d/PROJECT/Context.md +49 -0
  56. package/templates-app/tps-3d/PROJECT/Requirements.md +38 -0
  57. package/templates-app/tps-3d/PROJECT/Status.md +41 -0
  58. package/templates-app/tps-3d/PROJECT/Structure.md +44 -0
  59. package/templates-app/tps-3d/docs/project-3d-rules.md +38 -0
  60. package/templates-app/tps-3d/index.html +244 -0
  61. package/templates-app/tps-3d/package.json +25 -0
  62. package/templates-app/tps-3d/src/behaviors.ts +405 -0
  63. package/templates-app/tps-3d/src/game.scene.json +677 -0
  64. package/templates-app/tps-3d/src/main.ts +64 -0
  65. package/templates-app/tps-3d/tsconfig.json +13 -0
  66. package/templates-app/tps-3d/verify.ts +167 -0
  67. package/templates-app/tps-3d/vite.config.ts +5 -0
  68. package/templates-app/village-quest-3d/PROJECT/Context.md +39 -0
  69. package/templates-app/village-quest-3d/PROJECT/Requirements.md +36 -0
  70. package/templates-app/village-quest-3d/PROJECT/Status.md +26 -0
  71. package/templates-app/village-quest-3d/PROJECT/Structure.md +30 -0
  72. package/templates-app/village-quest-3d/docs/project-3d-rules.md +38 -0
  73. package/templates-app/village-quest-3d/index.html +68 -0
  74. package/templates-app/village-quest-3d/package.json +25 -0
  75. package/templates-app/village-quest-3d/src/behaviors.ts +529 -0
  76. package/templates-app/village-quest-3d/src/grove.scene.json +826 -0
  77. package/templates-app/village-quest-3d/src/main.ts +35 -0
  78. package/templates-app/village-quest-3d/src/quest.ts +18 -0
  79. package/templates-app/village-quest-3d/src/village.scene.json +680 -0
  80. package/templates-app/village-quest-3d/tsconfig.json +13 -0
  81. package/templates-app/village-quest-3d/verify.ts +254 -0
  82. package/templates-app/village-quest-3d/vite.config.ts +5 -0
@@ -0,0 +1,24 @@
1
+ # Beacon Isle — Structure
2
+
3
+ ```
4
+ generate-world.ts the WORLD AUTHORING script (bun run world):
5
+ island terrain + sea + groves/grass/flowers +
6
+ quest sites on walkable ground → src/game.scene.json
7
+ index.html canvas + loading bar
8
+ src/main.ts preload → createGame3D
9
+ src/game.scene.json GENERATED — do not hand-edit; edit generate-world.ts
10
+ src/behaviors.ts IsleDirector (quest FSM, terrain-nav shade AI,
11
+ ward relighting, fireworks, respawn) + SwordStrike
12
+ verify.ts audit + quest E2E + hunt + death/respawn + replay
13
+ ```
14
+
15
+ ## Key decisions
16
+
17
+ - The nav grid is built ONCE in `IsleDirector.onReady` from the live
18
+ Terrain3D; shade hunts re-path every 0.4 s with `findPath` (cheap A*).
19
+ - Shades are primitive-built (capsule + gem hood + emissive eyes + Trail3D
20
+ wisp) — zero external meshes, instantly reskinnable.
21
+ - Quest state is a module singleton (`quest`) so death → `goToScene` respawn
22
+ keeps lit wards; `IsleDirector.onReady` re-applies their glow.
23
+ - The whole Terrain subtree is static EXCEPT Sea and Clouds (auditScene
24
+ catches the freeze-the-water mistake if you regress this).
@@ -0,0 +1,38 @@
1
+ <userRequest>
2
+ YOU MUST follow these rules EXACTLY when vibe-coding on this Incanto template:
3
+
4
+ 1. 📖 READ THE SKILLS FIRST: `node_modules/incanto/skills/` is the engine
5
+ manual, version-pinned to what is installed. Start with
6
+ `incanto-building-3d-games.md`, `incanto-3d-character.md`,
7
+ `incanto-gameplay-behaviors.md`, `incanto-environment.md` and
8
+ `incanto-audio.md` — this template composes all five.
9
+ 2. 🧱 STRUCTURE IS JSON: scenes, nodes, props, assets, input maps and
10
+ replication all live in `src/game.scene.json`. Add nodes there (or with
11
+ `npx incanto-editor`), NOT by constructing them ad-hoc in code.
12
+ 3. 🧠 LOGIC IS BEHAVIORS: gameplay code = small TypeScript Behavior classes,
13
+ registered with `registerBehavior('Name', Class)` and attached in JSON via
14
+ `"script": { "name": "Name" }`. Reach for a BUILT-IN gameplay behavior
15
+ (Health, Chase, WaveSpawner, DamageOnContact, ScoreKeeper…) before writing
16
+ your own — this game's only custom behaviors are `Shoot` and `HudUpdater`.
17
+ 4. 🔑 UIDS ARE GENERATED: every node uid comes from
18
+ `import { newUid } from 'incanto'`. NEVER invent readable uid strings.
19
+ 5. 📦 ASSETS ARE DECLARED: `assets` entries need `type` + `url`; reference
20
+ them as `"$key"`. Free extra key-values are preserved — use them to leave
21
+ notes for yourself (license, palette, source prompt).
22
+ 6. ⬆️ Y IS UP: 3D space is y-UP meters, +Z is "south", rotations are degrees
23
+ (Euler XYZ). Negative gravity falls.
24
+ 7. 🧲 COLLIDERS ARE PROPS: `"collider": { "shape": "box"|"sphere"|"capsule", … }`
25
+ on a body node — never child shape nodes. Wrong shapes hard-fail at load.
26
+ 8. 🖥️ THE HUD IS DOM, NOT NODES: 3D scenes have no 2D `UILayer`/`Label` nodes
27
+ (those are `incanto/2d`). The HUD + crosshair + banner are plain HTML in
28
+ `index.html`; `HudUpdater` writes the live numbers into them (guarded so
29
+ headless runs are a no-op).
30
+ 9. 🐛 DEBUG WHEN UNSURE: `physics.debugDraw = true` (the object
31
+ `enablePhysics3D` returns) draws every collider in the running game; or boot
32
+ with `?incanto_debug=1` for the live Explorer/Inspector/Stats overlay.
33
+ 10. 🎬 DELTA DISCIPLINE: only write props that differ from defaults — the
34
+ loader treats unknown/garbage props as hard errors, which is your friend.
35
+ 11. ✅ VERIFY LIKE A USER: `bun run check` validates the scene, `bun run verify`
36
+ proves the loop headlessly, then `bun run dev` and actually PLAY what you
37
+ changed (move, shoot, clear a wave) before declaring it done.
38
+ </userRequest>