incanto 0.32.0 → 0.34.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/dist/2d.d.ts +59 -2
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +8 -3
- package/dist/3d.js +4 -4
- package/dist/{behavior-D_jMpFh8.d.ts → behavior-CtPScDMo.d.ts} +149 -1
- package/dist/{create-game-bKHgHcsZ.js → create-game-CFNqoqOX.js} +13 -6
- package/dist/{create-game-gXI7PYl0.js → create-game-QTfghzwM.js} +11 -5
- package/dist/debug.d.ts +1 -1
- package/dist/{duplicate-KRPtUtzl.js → duplicate-DlOvknDO.js} +1 -1
- package/dist/editor.js +35 -0
- package/dist/{environment-presets--DigHNg4.js → environment-presets-B6WiUsaO.js} +2 -2
- package/dist/{gameplay-BftxM_It.js → gameplay-BxFtmfSe.js} +90 -2
- package/dist/gameplay.d.ts +1 -1
- package/dist/gameplay.js +1 -1
- package/dist/index.d.ts +175 -23
- package/dist/index.js +5 -58
- package/dist/{loader-BlaRQGaA.js → loader-BwR0DxeM.js} +66 -0
- package/dist/{loader-BYBrqTxP.d.ts → loader-DmXfj6Uv.d.ts} +1 -1
- package/dist/net.d.ts +1 -1
- package/dist/net.js +3 -3
- package/dist/{pathfinding-BwhqPD3i.d.ts → pathfinding-DRCe89SI.d.ts} +1 -1
- package/dist/{physics-2d-D9wquBvK.js → physics-2d-BuyAwsW5.js} +12 -2
- package/dist/{physics-3d-CnPygVGo.js → physics-3d-C8Kn_Nyb.js} +55 -9
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{register-tkR_8tWg.js → register-BLPC10Mj.js} +145 -8
- package/dist/{register-Dzkd6-os.js → register-G3edsjJ2.js} +752 -16
- package/dist/{register-CUY284Is.js → register-OodmuUMK.js} +2 -2
- package/dist/{test-WwRIlXsK.js → test-C4B5znap.js} +10 -10
- package/dist/test.d.ts +2 -2
- package/dist/test.js +1 -1
- package/dist/vite.js +1 -1
- package/editor/assets/{agent8-C5k1nTCH.js → agent8-BTODHtdM.js} +1 -1
- package/editor/assets/{debug-BT_0mjk-.js → debug-CJEz4EwC.js} +1 -1
- package/editor/assets/{index-gfyrByWw.js → index-BYCso8Bf.js} +90 -90
- package/editor/index.html +1 -1
- package/package.json +1 -1
- package/schemas/scene.schema.json +667 -11
- package/skills/incanto-audio.md +43 -0
- package/skills/incanto-building-2d-games.md +36 -0
- package/skills/incanto-hud.md +97 -0
- package/skills/incanto-node-reference.md +131 -3
- package/skills/incanto-physics-and-input.md +50 -0
- package/templates-app/beacon-isle-3d/docs/project-3d-rules.md +40 -19
- package/templates-app/beacon-isle-3d/package.json +1 -1
- package/templates-app/tps-3d/docs/project-3d-rules.md +41 -19
- package/templates-app/tps-3d/package.json +1 -1
- package/templates-app/village-quest-3d/docs/project-3d-rules.md +40 -19
- package/templates-app/village-quest-3d/package.json +1 -1
|
@@ -5,15 +5,17 @@ YOU MUST follow these rules EXACTLY when vibe-coding on this Incanto template:
|
|
|
5
5
|
manual, version-pinned to what is installed. Start with
|
|
6
6
|
`incanto-building-3d-games.md`, `incanto-3d-character.md`,
|
|
7
7
|
`incanto-gameplay-behaviors.md`, `incanto-environment.md` and
|
|
8
|
-
`incanto-
|
|
8
|
+
`incanto-hud.md` — this template composes them —
|
|
9
|
+
and FINISH with `incanto-verifying-your-game.md` (rule 11).
|
|
9
10
|
2. 🧱 STRUCTURE IS JSON: scenes, nodes, props, assets, input maps and
|
|
10
|
-
replication all live in `src
|
|
11
|
+
replication all live in `src/*.scene.json`. Add nodes there (or with
|
|
11
12
|
`npx incanto-editor`), NOT by constructing them ad-hoc in code.
|
|
12
13
|
3. 🧠 LOGIC IS BEHAVIORS: gameplay code = small TypeScript Behavior classes,
|
|
13
14
|
registered with `registerBehavior('Name', Class)` and attached in JSON via
|
|
14
15
|
`"script": { "name": "Name" }`. Reach for a BUILT-IN gameplay behavior
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
before writing your own — this template already uses
|
|
17
|
+
Health, DamageOnContact, Interactable, PathFollow, and its only custom behaviors are
|
|
18
|
+
`VillageDirector`, `GroveDirector` and `SwordStrike`.
|
|
17
19
|
4. 🔑 UIDS ARE GENERATED: every node uid comes from
|
|
18
20
|
`import { newUid } from 'incanto'`. NEVER invent readable uid strings.
|
|
19
21
|
5. 📦 ASSETS ARE DECLARED: `assets` entries need `type` + `url`; reference
|
|
@@ -23,21 +25,40 @@ YOU MUST follow these rules EXACTLY when vibe-coding on this Incanto template:
|
|
|
23
25
|
(Euler XYZ). Negative gravity falls.
|
|
24
26
|
7. 🧲 COLLIDERS ARE PROPS: `"collider": { "shape": "box"|"sphere"|"capsule", … }`
|
|
25
27
|
on a body node — never child shape nodes. Wrong shapes hard-fail at load.
|
|
26
|
-
8. 🖥️ THE HUD IS
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
8. 🖥️ THE HUD IS NODES: this template's HUD lives in the scene as a
|
|
29
|
+
`HudLayer` with `UiText`/`UiBar` children — the engine builds the DOM for
|
|
30
|
+
them and positions them by anchor. Edit the HUD in `*.scene.json` like any
|
|
31
|
+
other node. (A DOM-in-`index.html` HUD is the other valid shape, and what
|
|
32
|
+
`tps-3d` does; both are supported — do not mix them in one screen.)
|
|
33
|
+
9. 🐛 DEBUG WHEN UNSURE: `VITE_INCANTO_DEBUG=1 bun run dev` adds the ☰ debug
|
|
34
|
+
menu — Explorer/Inspector (click a node, see and edit its live props), Logs,
|
|
35
|
+
Stats and Colliders (every physics shape as a wireframe, drawn by the same
|
|
36
|
+
Rapier the game runs). There is NO `VITE_INCANTO_DEBUG=1` URL toggle: it was
|
|
37
|
+
removed as deploy-unsafe. Never ship the env flag on.
|
|
33
38
|
10. 🎬 DELTA DISCIPLINE: only write props that differ from defaults — the
|
|
34
39
|
loader treats unknown/garbage props as hard errors, which is your friend.
|
|
35
|
-
11. ✅ VERIFY LIKE A USER
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
11. ✅ VERIFY LIKE A USER, THEN READ THE FOUR SIGNALS. `bun run check` and
|
|
41
|
+
`bun run verify` are the start, not the end — you cannot SEE this game, and
|
|
42
|
+
each of these answers a failure that otherwise looks like nothing at all:
|
|
43
|
+
|
|
44
|
+
| read | it is not clean when |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `bunx incanto-check` | the scene will not load, or renders black (no light) |
|
|
47
|
+
| `stats().errors` | something threw and was skipped to keep the game alive |
|
|
48
|
+
| `assetErrors()` | a model or texture 404'd — the thing is simply not there |
|
|
49
|
+
| `framing` | the camera points the wrong way, or nothing is lit |
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
printf 'step 500\nframing\nquit\n' | bunx incanto-play src/game.scene.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`framing` reports what the camera SEES — on screen / off screen / behind it
|
|
56
|
+
— plus what lights the scene and which colliders intersect. `behind` looks
|
|
57
|
+
exactly like "my model did not load"; nothing else can tell you apart.
|
|
58
|
+
Then `bun run dev` and actually PLAY what you changed.
|
|
59
|
+
12. 🧯 A THROWN ERROR NO LONGER STOPS THE GAME: a behavior that throws is
|
|
60
|
+
reported once (node, script, phase, file:line) and SKIPPED — your script
|
|
61
|
+
stops, the node it is attached to keeps running, the game plays on. So a
|
|
62
|
+
game that looks fine can still be broken: read `stats().errors`, and
|
|
63
|
+
`engine.resumeErroredNodes()` after you fix it.
|
|
43
64
|
</userRequest>
|