incanto 0.69.0 → 0.71.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/bin/_behaviors-loader.mjs +22 -0
- package/bin/_read-json.mjs +28 -0
- package/bin/incanto-assets.mjs +5 -4
- package/bin/incanto-check.mjs +58 -31
- package/bin/incanto-editor.mjs +128 -5
- package/bin/incanto-env.mjs +3 -2
- package/bin/incanto-feel.mjs +24 -13
- package/bin/incanto-frame.mjs +8 -1
- package/bin/incanto-multiplay.mjs +11 -9
- package/bin/incanto-new.mjs +105 -10
- package/bin/incanto-play.mjs +158 -16
- package/bin/incanto-playtest.mjs +66 -23
- package/bin/incanto-skills.mjs +14 -2
- package/bin/incanto-verify.mjs +121 -102
- package/bin/incanto.mjs +3 -2
- package/dist/2d.d.ts +296 -34
- package/dist/2d.js +4 -4
- package/dist/3d.d.ts +157 -9
- package/dist/3d.js +8 -8
- package/dist/{agent8-CvsfVskX.js → agent8-Cfmd3ar_.js} +61 -8
- package/dist/{audio-player-C0j2k-yB.d.ts → audio-player-L8yccdMP.d.ts} +2 -2
- package/dist/{behavior-rm8vVzu_.d.ts → behavior-Dcz0fr1S.d.ts} +755 -46
- package/dist/{create-game-CwxEDlCm.js → create-game-CH4kt78v.js} +143 -60
- package/dist/{create-game-CvJ1wSRP.js → create-game-LCHBLfA4.js} +98 -48
- package/dist/debug.d.ts +1 -1
- package/dist/debug.js +2 -3
- package/dist/diagnostics-Cu85N3tL.d.ts +12 -0
- package/dist/{editor-switch-CnIOiyNJ.d.ts → editor-switch-CFU9mCec.d.ts} +22 -13
- package/dist/editor.js +1088 -882
- package/dist/env.d.ts +1 -1
- package/dist/env.js +5 -3
- package/dist/{environment-presets-BO-7XoFV.js → environment-presets-99BzP_L-.js} +298 -45
- package/dist/{frame-report-Dlq13Gyj.js → frame-report-D-_7YF2G.js} +1 -1
- package/dist/{gameplay-D1KixWK8.js → gameplay-CNULJvwh.js} +914 -214
- package/dist/gameplay.d.ts +254 -10
- package/dist/gameplay.js +2 -2
- package/dist/{heightmap-CRK0M4jT.js → heightmap-BYgD5Edk.js} +1 -1
- package/dist/index.d.ts +179 -13
- package/dist/index.js +10 -12
- package/dist/json-CfTjpvW8.js +67 -0
- package/dist/{loader-DadV2QCT.d.ts → loader-8-IHvbKD.d.ts} +2 -2
- package/dist/net.d.ts +27 -3
- package/dist/net.js +2 -2
- package/dist/{noise-CGUMx44x.js → noise-D3nPpmFg.js} +1 -1
- package/dist/{physics-2d-CF5yyjbj.js → physics-2d-FhrXUc6B.js} +136 -11
- package/dist/{physics-3d-DbYaEcZy.js → physics-3d-CFEGxBXZ.js} +104 -23
- package/dist/{teardown-CMqFVxO9.js → picking-DVo7fI13.js} +104 -13
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/{register-DbVArsns.js → register-BYQCBySi.js} +429 -28
- package/dist/{register-mmfugpaQ.js → register-DuVdzxbq.js} +594 -831
- package/dist/{replay-BEHLDcQV.js → replay-DEvp3kyV.js} +224 -14
- package/dist/{replay-BQfkX4x7.d.ts → replay-F7IZHdFR.d.ts} +20 -3
- package/dist/{schema-B6ugCV1Q.d.ts → rng-Bb-IutXB.d.ts} +38 -21
- package/dist/{rng-DP-SR7eg.js → rng-CDOMybym.js} +22 -0
- package/dist/{loader-DZE7B07H.js → save-slots-Bvuh2p_r.js} +4619 -2318
- package/dist/{split-screen-Cg76MCV5.d.ts → split-screen-CIYf1zSf.d.ts} +36 -4
- package/dist/{split-screen-CauMwu6y.js → split-screen-eULetcg-.js} +159 -26
- package/dist/{sprite-animation-CY-mrr1L.js → sprite-animation-CqR2o3SA.js} +39 -8
- package/dist/{src-CYEu-_S9.js → src-_jk0qLsS.js} +2 -17
- package/dist/test-CmN54kWv.js +4264 -0
- package/dist/test.d.ts +639 -30
- package/dist/test.js +3 -3
- package/dist/touch-BnCyPA0G.js +519 -0
- package/dist/vite.d.ts +20 -37
- package/dist/vite.js +177 -7
- package/dist/{webgl-unavailable-Z5_g8x9H.js → webgl-unavailable-C8aDbGmR.js} +44 -0
- package/editor/assets/agent8-yLIEYHbd.js +1 -0
- package/editor/assets/{debug-CMULinBW.js → debug-u31w_yhq.js} +2 -2
- package/editor/assets/index-DK9xMGpW.js +11046 -0
- package/editor/index.html +1 -1
- package/package.json +4 -14
- package/schemas/scene.schema.json +34 -3
- package/skills/incanto-3d-character.md +14 -1
- package/skills/incanto-3d-models.md +12 -0
- package/skills/incanto-assets.md +9 -1
- package/skills/incanto-audio.md +8 -2
- package/skills/incanto-behaviors-and-scripts.md +105 -7
- package/skills/incanto-building-2d-games.md +97 -10
- package/skills/incanto-building-3d-games.md +58 -4
- package/skills/incanto-editor.md +46 -7
- package/skills/incanto-environment.md +19 -1
- package/skills/incanto-game-feel.md +70 -0
- package/skills/incanto-gameplay-behaviors.md +172 -20
- package/skills/incanto-hud.md +142 -7
- package/skills/incanto-localization.md +13 -5
- package/skills/incanto-multiplayer.md +83 -3
- package/skills/incanto-node-reference.md +239 -59
- package/skills/incanto-performance.md +52 -0
- package/skills/incanto-physics-and-input.md +123 -24
- package/skills/incanto-playtesting.md +112 -2
- package/skills/incanto-save-slots.md +217 -7
- package/skills/incanto-scene-json-authoring.md +69 -12
- package/skills/incanto-verifying-your-game.md +207 -10
- package/skills/incanto-web-integration.md +28 -0
- package/skills/incanto-your-first-game.md +3 -1
- package/templates-app/beacon-isle-3d/generate-world.ts +77 -9
- package/templates-app/beacon-isle-3d/package.json +2 -2
- package/templates-app/beacon-isle-3d/src/behaviors.ts +22 -0
- package/templates-app/beacon-isle-3d/src/game.scene.json +143 -600
- package/templates-app/beacon-isle-3d/src/main.ts +11 -1
- package/templates-app/beacon-isle-3d/tsconfig.json +1 -1
- package/templates-app/beacon-isle-3d/verify.ts +3 -1
- package/templates-app/molehill-2d/.incanto/playtest/lost-seed1.json +4277 -0
- package/templates-app/molehill-2d/PROJECT/Context.md +58 -0
- package/templates-app/molehill-2d/PROJECT/Requirements.md +39 -0
- package/templates-app/molehill-2d/PROJECT/Status.md +27 -0
- package/templates-app/molehill-2d/PROJECT/Structure.md +48 -0
- package/templates-app/molehill-2d/docs/project-2d-rules.md +44 -0
- package/templates-app/molehill-2d/index.html +73 -0
- package/templates-app/molehill-2d/package.json +23 -0
- package/templates-app/molehill-2d/src/behaviors.ts +198 -0
- package/templates-app/molehill-2d/src/game.scene.json +1205 -0
- package/templates-app/molehill-2d/src/main.ts +41 -0
- package/templates-app/molehill-2d/tsconfig.json +13 -0
- package/templates-app/molehill-2d/verify.ts +247 -0
- package/templates-app/molehill-2d/vite.config.ts +12 -0
- package/templates-app/platformer-2d/package.json +2 -2
- package/templates-app/platformer-2d/src/game.scene.json +178 -986
- package/templates-app/platformer-2d/src/main.ts +11 -1
- package/templates-app/platformer-2d/tsconfig.json +1 -1
- package/templates-app/star-survivor/package.json +2 -2
- package/templates-app/star-survivor/src/game.scene.json +43 -216
- package/templates-app/star-survivor/src/main.ts +11 -1
- package/templates-app/star-survivor/tsconfig.json +1 -1
- package/templates-app/tps-3d/PROJECT/Context.md +1 -1
- package/templates-app/tps-3d/package.json +2 -2
- package/templates-app/tps-3d/src/behaviors.ts +19 -1
- package/templates-app/tps-3d/src/game.scene.json +66 -263
- package/templates-app/tps-3d/src/main.ts +13 -2
- package/templates-app/tps-3d/tsconfig.json +1 -1
- package/templates-app/village-quest-3d/.incanto/playtest/swapped-seed1.json +1735 -0
- package/templates-app/village-quest-3d/package.json +2 -2
- package/templates-app/village-quest-3d/src/behaviors.ts +42 -4
- package/templates-app/village-quest-3d/src/grove.scene.json +68 -306
- package/templates-app/village-quest-3d/src/main.ts +11 -1
- package/templates-app/village-quest-3d/src/village.scene.json +202 -863
- package/templates-app/village-quest-3d/tsconfig.json +1 -1
- package/templates-app/village-quest-3d/verify.ts +14 -1
- package/dist/duplicate-Dj4L-5AA.js +0 -22
- package/dist/json-CwwhxQgb.js +0 -36
- package/dist/registry-CF70EArN.js +0 -212
- package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
- package/dist/test-D6ISmuFE.js +0 -2383
- package/dist/touch-DEAmqGdf.js +0 -225
- package/editor/assets/agent8-BDvaZMQJ.js +0 -1
- package/editor/assets/index-CZIRr5EL.js +0 -10958
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "vite build",
|
|
8
8
|
"typecheck": "tsc --noEmit",
|
|
9
|
-
"check": "incanto-check src",
|
|
9
|
+
"check": "incanto-check src --behaviors src/behaviors.ts",
|
|
10
10
|
"verify": "bun verify.ts"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
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.
|
|
16
|
+
"incanto": "^0.71.0",
|
|
17
17
|
"three": "^0.184.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
UiText,
|
|
24
24
|
Voice,
|
|
25
25
|
} from 'incanto';
|
|
26
|
-
import { Behavior, findPath, gridFromRows } from 'incanto';
|
|
26
|
+
import { Behavior, findPath, gridFromRows, Timer } from 'incanto';
|
|
27
27
|
import { mergeSolidRects, parseCells } from 'incanto/2d';
|
|
28
28
|
import type { Camera3D, CharacterController3D, Node3D, Trail3D } from 'incanto/3d';
|
|
29
29
|
import { MeshInstance3D, Particles3D, StaticBody3D } from 'incanto/3d';
|
|
@@ -161,6 +161,16 @@ function ambientUpdate(
|
|
|
161
161
|
// ---- VillageDirector --------------------------------------------------------------
|
|
162
162
|
|
|
163
163
|
export class VillageDirector extends Behavior {
|
|
164
|
+
/**
|
|
165
|
+
* `QUEST COMPLETE` was a banner and nothing else.
|
|
166
|
+
*
|
|
167
|
+
* The village had an ending — the wolves cleared, the Elder's thanks, a
|
|
168
|
+
* restart button — and emitted no `won`, so the playtest reported
|
|
169
|
+
* `no win declared in this scene — nothing emits won/lost, so there is
|
|
170
|
+
* nothing to reach` about a game that has one. The same shape as the isle's.
|
|
171
|
+
*/
|
|
172
|
+
static readonly signals: readonly string[] = ['won'];
|
|
173
|
+
|
|
164
174
|
private wind: Voice | null = null;
|
|
165
175
|
private gateHinted = false;
|
|
166
176
|
|
|
@@ -196,6 +206,16 @@ export class VillageDirector extends Behavior {
|
|
|
196
206
|
if (engine && this.dialogue.active && engine.input.justPressed('interact')) {
|
|
197
207
|
this.dialogue.advance();
|
|
198
208
|
}
|
|
209
|
+
/*
|
|
210
|
+
* R restarts once the quest is done — the same thing the button does.
|
|
211
|
+
*
|
|
212
|
+
* The scene has always declared `"restart": { "keys": ["KeyR"] }` and
|
|
213
|
+
* nothing read it, so this game's own control vocabulary promised a key
|
|
214
|
+
* that did nothing. `incanto-playtest` now says so:
|
|
215
|
+
* `declared and never read: \`restart\``.
|
|
216
|
+
*/
|
|
217
|
+
const restart = engine ? engine.input.justPressed('restart') : false;
|
|
218
|
+
if (restart && quest.done) this.onRestart();
|
|
199
219
|
}
|
|
200
220
|
|
|
201
221
|
/** Elder.interacted → here (scene connection). */
|
|
@@ -214,6 +234,7 @@ export class VillageDirector extends Behavior {
|
|
|
214
234
|
const banner = this.node.getNode('HUD/Banner') as UiBanner;
|
|
215
235
|
talk.on('dialogueFinished', () => {
|
|
216
236
|
banner.show('QUEST COMPLETE');
|
|
237
|
+
this.node.emit('won');
|
|
217
238
|
(this.node.getNode('HUD/RestartBtn') as UiButton).visible = true;
|
|
218
239
|
(this.node.getNode('HUD/Quest') as UiText).text = 'Emberwood is safe.';
|
|
219
240
|
});
|
|
@@ -573,7 +594,18 @@ export class SwordStrike extends Behavior {
|
|
|
573
594
|
/** Strike bookkeeping: hits per wolf (module-scope — survives behavior instances). */
|
|
574
595
|
const wolfHits = new WeakMap<Node, number>();
|
|
575
596
|
|
|
576
|
-
/**
|
|
597
|
+
/**
|
|
598
|
+
* Red hurt-flash on every mesh of the wolf, reverted a beat later.
|
|
599
|
+
*
|
|
600
|
+
* The beat is a `Timer`, not a `setTimeout` — which is what this was, and what
|
|
601
|
+
* `incanto-behaviors-and-scripts.md` calls "the canonical serializable game
|
|
602
|
+
* clock — NEVER setTimeout in game logic". Three things a wall-clock timeout
|
|
603
|
+
* gets wrong here: it keeps running while the game is paused (`timeScale: 0`),
|
|
604
|
+
* it ignores `timeScale` entirely, and in a headless run — where a minute of
|
|
605
|
+
* play takes a second — it fires long after the frame that asked for it, so a
|
|
606
|
+
* seeded playtest stops being reproducible. The node is a child of the wolf,
|
|
607
|
+
* so a wolf that dies mid-flash takes its timer with it.
|
|
608
|
+
*/
|
|
577
609
|
function flashWolf(wolf: Node): void {
|
|
578
610
|
const meshes: { material: Record<string, unknown> }[] = [];
|
|
579
611
|
const walk = (n: Node): void => {
|
|
@@ -585,11 +617,17 @@ function flashWolf(wolf: Node): void {
|
|
|
585
617
|
walk(wolf);
|
|
586
618
|
const originals = meshes.map((m) => m.material);
|
|
587
619
|
for (const m of meshes) m.material = { ...m.material, color: '#ff5544' };
|
|
588
|
-
|
|
620
|
+
const beat = new Timer('Unflash');
|
|
621
|
+
beat.waitTime = 0.13;
|
|
622
|
+
beat.oneShot = true;
|
|
623
|
+
beat.autostart = true;
|
|
624
|
+
beat.on('timeout', () => {
|
|
589
625
|
meshes.forEach((m, i) => {
|
|
590
626
|
if (wolf.tree) m.material = originals[i] as Record<string, unknown>;
|
|
591
627
|
});
|
|
592
|
-
|
|
628
|
+
beat.queueFree();
|
|
629
|
+
});
|
|
630
|
+
wolf.addChild(beat);
|
|
593
631
|
}
|
|
594
632
|
|
|
595
633
|
export const BEHAVIORS = { VillageDirector, GroveDirector, SwordStrike };
|