incanto 0.55.0 → 0.56.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/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-BfqmvXYD.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-DTdwKKIv.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.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -203,11 +203,24 @@ A nameplate, a sign, a damage number:
203
203
  - It IS a `Sprite3D`, so `anchor`, `tint`, `opacity`, `alphaTest`, `renderOrder`
204
204
  and `orderGroup` all work exactly as they do there.
205
205
 
206
- A **damage number** is this node plus two lines: set `text`, then float it up
207
- and fade `opacity` to 0 over ~0.6 s and `queueFree()`. Re-rasterising is
208
- handled — the texture is rebuilt only when the text (or size/colour/font)
209
- changes, and the old one is disposed, so a number per hit does not leak a
210
- texture per hit.
206
+ A **damage number** is this node plus the `FloatAway` behavior, and no
207
+ TypeScript of your own:
208
+
209
+ ```json
210
+ { "name": "Hit", "type": "Label3D",
211
+ "props": { "text": "12", "height": 0.35, "color": "#ff5a5a" },
212
+ "script": { "name": "FloatAway", "props": { "rise": 1.2, "seconds": 0.7, "drift": 0.3 } } }
213
+ ```
214
+
215
+ It rises with an ease-out (constant speed reads as a lift, not a hit), holds at
216
+ full opacity for `hold` of its life so the number is readable, fades, and frees
217
+ itself — so a hundred numbers a fight leave nothing in the tree. `drift` keeps
218
+ ten at once from stacking into one. Spawning is `duplicateNode` + set `text` and
219
+ `position`.
220
+
221
+ Re-rasterising is handled: the texture is rebuilt only when the text (or
222
+ size/colour/font) changes, and the old one is disposed, so a number per hit does
223
+ not leak a texture per hit.
211
224
 
212
225
  | Prop | Default | Notes |
213
226
  |---|---|---|
@@ -828,6 +828,25 @@ import { CameraShake, Cooldown, hitStop, screenFlash } from 'incanto/gameplay';
828
828
  tested. (A stepped frame still HAPPENS while paused: `update` runs with
829
829
  `dt = 0`, which is how the pause menu's own key polling keeps working.)
830
830
 
831
+ ### `FloatAway` — rise, fade, gone
832
+
833
+ The second half of a damage number, a pickup puff, a `+50`:
834
+
835
+ ```json
836
+ { "name": "Hit", "type": "Label3D",
837
+ "props": { "text": "12", "height": 0.35 },
838
+ "script": { "name": "FloatAway", "props": { "rise": 1.2, "seconds": 0.7, "drift": 0.3 } } }
839
+ ```
840
+
841
+ `rise` (world units, negative sinks) · `seconds` · `hold` (fraction of the life
842
+ at full opacity before the fade) · `drift` (sideways, so ten at once do not
843
+ stack) · `freeOnEnd` (default true).
844
+
845
+ Works on anything with `position` and `opacity` — a `Label3D`, a `Sprite3D`
846
+ puff, a 2D `Label`. It reads the start position ONCE, so the ease does not
847
+ compound, and it frees the node a frame after it is invisible rather than on the
848
+ frame it gets there (which reads as a flicker).
849
+
831
850
  ## Did the effect fire?
832
851
 
833
852
  Sound has `engine.audio`; vision has **`engine.effects`**, and the question is
@@ -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.55.0",
17
+ "incanto": "^0.56.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {
@@ -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.55.0",
16
+ "incanto": "^0.56.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -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.55.0",
16
+ "incanto": "^0.56.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {