incanto 0.42.0 → 0.43.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 (32) hide show
  1. package/bin/incanto-feel.mjs +20 -1
  2. package/dist/2d.js +1 -1
  3. package/dist/3d.js +4 -4
  4. package/dist/{create-game-DItIRyXH.js → create-game-B3vBWgVD.js} +5 -4
  5. package/dist/{create-game-9KPppR0L.js → create-game-DFRbG0Bj.js} +3 -2
  6. package/dist/{environment-presets-Vl5xBsXp.js → environment-presets-Ds5kXLoF.js} +1 -1
  7. package/dist/{gameplay-DRi9524r.js → gameplay-BQOeAid6.js} +37 -0
  8. package/dist/gameplay.d.ts +17 -0
  9. package/dist/gameplay.js +1 -1
  10. package/dist/index.js +1 -1
  11. package/dist/{physics-3d-C2G604O1.js → physics-3d-CLPFv99o.js} +2 -2
  12. package/dist/react.js +1 -1
  13. package/dist/{src-cU57Uwdw.js → src-CwYxzZKl.js} +1 -1
  14. package/dist/{teardown-CCtAMDLB.js → teardown-yePMOE1K.js} +32 -1
  15. package/dist/{test-DuOD1DO8.js → test-BMgiiD5i.js} +117 -5
  16. package/dist/test.d.ts +35 -1
  17. package/dist/test.js +2 -2
  18. package/dist/vite.js +2 -2
  19. package/editor/assets/{agent8-Csw0T7jh.js → agent8-Cl3qFuBB.js} +1 -1
  20. package/editor/assets/{debug-C3qeBD4X.js → debug-u3yLCciO.js} +1 -1
  21. package/editor/assets/{index-B1rUkWxB.js → index-Dk2ZlO68.js} +60 -60
  22. package/editor/index.html +1 -1
  23. package/package.json +1 -1
  24. package/skills/incanto-3d-character.md +19 -0
  25. package/skills/incanto-gameplay-behaviors.md +27 -0
  26. package/skills/incanto-node-reference.md +2 -0
  27. package/templates-app/beacon-isle-3d/package.json +1 -1
  28. package/templates-app/beacon-isle-3d/src/game.scene.json +47 -0
  29. package/templates-app/tps-3d/package.json +1 -1
  30. package/templates-app/tps-3d/src/game.scene.json +53 -0
  31. package/templates-app/village-quest-3d/package.json +1 -1
  32. package/templates-app/village-quest-3d/src/grove.scene.json +43 -0
package/editor/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Incanto Scene Editor</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
8
- <script type="module" crossorigin src="./assets/index-B1rUkWxB.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-Dk2ZlO68.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incanto",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -269,6 +269,25 @@ button is held — a free-roaming cursor never spins the camera. Vertical look i
269
269
  STANDARD (non-inverted): mouse UP looks up (in free view the camera swings down so
270
270
  it looks up at the character against the sky), mouse DOWN looks down.
271
271
 
272
+ ### Check it instead of reasoning about it
273
+
274
+ `bunx incanto-feel <scene.json>` now ends with the answer:
275
+
276
+ ```
277
+ facing: /Game/Player/Skin faces its travel (dot 1.00)
278
+ facing: /Game/Husk/Skin RUNS BACKWARDS (dot -1.00) — the skin points away from
279
+ the direction of travel.
280
+ ```
281
+
282
+ It drives the character, measures where it actually went, and dots that with the
283
+ skin's forward axis. **+1 is right, −1 is backwards**, and a declared
284
+ `skinYawOffset` is subtracted first — so a model whose art faces another way is
285
+ correctly configured, not a false alarm.
286
+
287
+ This cannot be an `auditScene` warning: a scene file has no velocity, and the bug
288
+ is a behavior writing a heading at runtime. `facingReport()` from `incanto/test`
289
+ is the same check for your own tests.
290
+
272
291
  ## First-person weapon viewmodel + the tracer-from-the-muzzle rule
273
292
 
274
293
  A weapon VIEWMODEL is just a `MeshInstance3D`/group child of the **root** `Camera`
@@ -797,6 +797,33 @@ flow.win('AREA CLEAR');
797
797
  flow.pause(); flow.resume();
798
798
  ```
799
799
 
800
+ ### A pause menu, without a script
801
+
802
+ `GameFlow` drives one for you. Declare a `pause` action, put a `UiPanel` named
803
+ `PauseMenu` in the HUD, and that is the whole feature:
804
+
805
+ ```json
806
+ { "input": { "pause": { "type": "button", "keys": ["Escape"] } },
807
+ "root": { "name": "Game", "type": "Node3D", "children": [
808
+ { "name": "Flow", "type": "Node", "script": { "name": "GameFlow" } },
809
+ { "name": "HUD", "type": "HudLayer", "children": [
810
+ { "name": "PauseMenu", "type": "UiPanel", "props": { "anchor": "center" },
811
+ "children": [{ "name": "Title", "type": "UiText", "props": { "text": "Paused" } }] }
812
+ ] }
813
+ ] } }
814
+ ```
815
+
816
+ The panel is hidden while playing and shown while paused — `GameFlow` owns its
817
+ `visible`, so do not set it yourself. `pauseAction` and `pausePanelPath` rename
818
+ either half; `pausePanelPath: ""` turns it off.
819
+
820
+ The pause key is polled in `update()`, which still runs at `timeScale 0` — a
821
+ menu that cannot be closed by the key that opened it is worse than no menu.
822
+
823
+ **Give the Flow its own node.** A node holds one behavior, and your root
824
+ probably already carries the game's director script.
825
+
826
+
800
827
  Terminal states ignore further transitions; the restart action (or
801
828
  `flow.restart()`) reloads the scene from its source JSON — fresh nodes,
802
829
  physics, input. Listen to the `flowChanged(state)` signal for custom UI.
@@ -1324,8 +1324,10 @@ Signals: `dayPhaseChanged`
1324
1324
  | Prop | Default | Kind |
1325
1325
  |---|---|---|
1326
1326
  | `restartAction` | `"restart"` | string |
1327
+ | `pauseAction` | `"pause"` | string |
1327
1328
  | `freezeOnEnd` | `true` | boolean |
1328
1329
  | `bannerPath` | `"%Banner"` | node path |
1330
+ | `pausePanelPath` | `"%PauseMenu"` | node path |
1329
1331
 
1330
1332
  Signals: `flowChanged`
1331
1333
 
@@ -14,7 +14,7 @@
14
14
  "@dimforge/rapier2d-compat": "0.19.3",
15
15
  "@dimforge/rapier3d-compat": "0.19.3",
16
16
  "@pixiv/three-vrm": "^3.5.3",
17
- "incanto": "^0.42.0",
17
+ "incanto": "^0.43.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {
@@ -67,6 +67,14 @@
67
67
  "type": "button",
68
68
  "keys": ["Mouse0", "KeyF"],
69
69
  "touch": "button"
70
+ },
71
+ "pause": {
72
+ "type": "button",
73
+ "keys": ["Escape"]
74
+ },
75
+ "restart": {
76
+ "type": "button",
77
+ "keys": ["KeyR"]
70
78
  }
71
79
  },
72
80
  "assets": {
@@ -106,6 +114,16 @@
106
114
  "name": "IsleDirector"
107
115
  },
108
116
  "children": [
117
+ {
118
+ "name": "Flow",
119
+ "type": "Node",
120
+ "script": {
121
+ "name": "GameFlow",
122
+ "props": {
123
+ "pausePanelPath": "%PauseMenu"
124
+ }
125
+ }
126
+ },
109
127
  {
110
128
  "name": "Terrain",
111
129
  "type": "Node3D",
@@ -2946,6 +2964,35 @@
2946
2964
  "anchor": "bottomRight",
2947
2965
  "shadow": true
2948
2966
  }
2967
+ },
2968
+ {
2969
+ "name": "PauseMenu",
2970
+ "type": "UiPanel",
2971
+ "props": {
2972
+ "anchor": "center",
2973
+ "layout": "column",
2974
+ "gap": 10,
2975
+ "padding": 18
2976
+ },
2977
+ "children": [
2978
+ {
2979
+ "name": "PausedTitle",
2980
+ "type": "UiText",
2981
+ "props": {
2982
+ "text": "Paused",
2983
+ "size": 24
2984
+ }
2985
+ },
2986
+ {
2987
+ "name": "ResumeHint",
2988
+ "type": "UiText",
2989
+ "props": {
2990
+ "text": "Esc to resume · R to restart",
2991
+ "size": 13,
2992
+ "color": "#c9d2dd"
2993
+ }
2994
+ }
2995
+ ]
2949
2996
  }
2950
2997
  ]
2951
2998
  }
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.42.0",
16
+ "incanto": "^0.43.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -54,6 +54,14 @@
54
54
  "reload": {
55
55
  "type": "button",
56
56
  "keys": ["KeyR"]
57
+ },
58
+ "pause": {
59
+ "type": "button",
60
+ "keys": ["Escape"]
61
+ },
62
+ "restart": {
63
+ "type": "button",
64
+ "keys": ["KeyR"]
57
65
  }
58
66
  },
59
67
  "assets": {
@@ -92,6 +100,16 @@
92
100
  }
93
101
  },
94
102
  "children": [
103
+ {
104
+ "name": "Flow",
105
+ "type": "Node",
106
+ "script": {
107
+ "name": "GameFlow",
108
+ "props": {
109
+ "pausePanelPath": "%PauseMenu"
110
+ }
111
+ }
112
+ },
95
113
  {
96
114
  "name": "Arena",
97
115
  "type": "Node3D",
@@ -651,6 +669,41 @@
651
669
  "script": {
652
670
  "name": "HudUpdater"
653
671
  }
672
+ },
673
+ {
674
+ "name": "HUD",
675
+ "type": "HudLayer",
676
+ "children": [
677
+ {
678
+ "name": "PauseMenu",
679
+ "type": "UiPanel",
680
+ "props": {
681
+ "anchor": "center",
682
+ "layout": "column",
683
+ "gap": 10,
684
+ "padding": 18
685
+ },
686
+ "children": [
687
+ {
688
+ "name": "PausedTitle",
689
+ "type": "UiText",
690
+ "props": {
691
+ "text": "Paused",
692
+ "size": 24
693
+ }
694
+ },
695
+ {
696
+ "name": "ResumeHint",
697
+ "type": "UiText",
698
+ "props": {
699
+ "text": "Esc to resume · R to restart",
700
+ "size": 13,
701
+ "color": "#c9d2dd"
702
+ }
703
+ }
704
+ ]
705
+ }
706
+ ]
654
707
  }
655
708
  ]
656
709
  },
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.42.0",
16
+ "incanto": "^0.43.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -67,6 +67,10 @@
67
67
  "restart": {
68
68
  "type": "button",
69
69
  "keys": ["KeyR"]
70
+ },
71
+ "pause": {
72
+ "type": "button",
73
+ "keys": ["Escape"]
70
74
  }
71
75
  },
72
76
  "assets": {
@@ -106,6 +110,16 @@
106
110
  "name": "GroveDirector"
107
111
  },
108
112
  "children": [
113
+ {
114
+ "name": "Flow",
115
+ "type": "Node",
116
+ "script": {
117
+ "name": "GameFlow",
118
+ "props": {
119
+ "pausePanelPath": "%PauseMenu"
120
+ }
121
+ }
122
+ },
109
123
  {
110
124
  "name": "Ground",
111
125
  "type": "StaticBody3D",
@@ -792,6 +806,35 @@
792
806
  "anchor": "bottomRight",
793
807
  "shadow": true
794
808
  }
809
+ },
810
+ {
811
+ "name": "PauseMenu",
812
+ "type": "UiPanel",
813
+ "props": {
814
+ "anchor": "center",
815
+ "layout": "column",
816
+ "gap": 10,
817
+ "padding": 18
818
+ },
819
+ "children": [
820
+ {
821
+ "name": "PausedTitle",
822
+ "type": "UiText",
823
+ "props": {
824
+ "text": "Paused",
825
+ "size": 24
826
+ }
827
+ },
828
+ {
829
+ "name": "ResumeHint",
830
+ "type": "UiText",
831
+ "props": {
832
+ "text": "Esc to resume · R to restart",
833
+ "size": 13,
834
+ "color": "#c9d2dd"
835
+ }
836
+ }
837
+ ]
795
838
  }
796
839
  ]
797
840
  }