incanto 0.11.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.
- package/README.md +22 -0
- package/bin/incanto-new.mjs +87 -0
- package/dist/2d.d.ts +2 -2
- package/dist/2d.js +3 -3
- package/dist/3d.d.ts +246 -71
- package/dist/3d.js +143 -4
- package/dist/{behavior-Bod1AyJS.d.ts → behavior-CPibUfnH.d.ts} +4 -2
- package/dist/{create-game-CdWhP6ve.js → create-game-Ct86zczq.js} +5 -5
- package/dist/{create-game-DZ_4Nfq8.js → create-game-J6g4QInv.js} +75 -24
- package/dist/debug.d.ts +1 -1
- package/dist/{duplicate-BEvGBtb_.js → duplicate-BINwP0WG.js} +1 -1
- package/dist/{gameplay-Dn3yidJw.js → gameplay-sSqrUcnz.js} +75 -3
- package/dist/gameplay.d.ts +37 -2
- package/dist/gameplay.js +2 -2
- package/dist/index.d.ts +3 -30
- package/dist/index.js +4 -4
- package/dist/{loader-B4OEXDZ8.js → loader-BZqOKfI2.js} +3 -1
- package/dist/{loader-BcUDfNHn.d.ts → loader-DILt9PGC.d.ts} +1 -1
- package/dist/net.d.ts +1 -1
- package/dist/net.js +3 -3
- package/dist/{audio-player-Dyjg5k92.d.ts → pathfinding-RWYkNKx9.d.ts} +29 -2
- package/dist/{physics-2d-DweTURFt.js → physics-2d-BiIdl51r.js} +8 -4
- package/dist/{physics-3d-Br97Ans2.js → physics-3d-DhaAaKJo.js} +8 -4
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{register-Cwc-yCYx.js → register-BFFE1Mh1.js} +2 -2
- package/dist/{register-ysLR3WQS.js → register-BFw4c83z.js} +508 -123
- package/dist/{register-BD6zgrv_.js → register-Djwckzgx.js} +2 -2
- package/dist/{register-DJZXxwAn.js → register-nObreUQR.js} +1 -1
- package/dist/test.d.ts +2 -2
- package/dist/test.js +10 -10
- package/editor/assets/{agent8-BxNvAcLA.js → agent8-BF8Jfbkl.js} +1 -1
- package/editor/assets/{index-DMCQXowF.js → index-DSq0gdhE.js} +53 -41
- package/editor/index.html +1 -1
- package/package.json +4 -2
- package/schemas/scene.schema.json +263 -0
- package/skills/incanto-3d-character.md +37 -1
- package/skills/incanto-building-3d-games.md +83 -0
- package/skills/incanto-editor.md +3 -3
- package/skills/incanto-gameplay-behaviors.md +23 -1
- package/skills/incanto-node-reference.md +51 -0
- package/templates-app/beacon-isle-3d/PROJECT/Context.md +44 -0
- package/templates-app/beacon-isle-3d/PROJECT/Requirements.md +16 -0
- package/templates-app/beacon-isle-3d/PROJECT/Status.md +38 -0
- package/templates-app/beacon-isle-3d/PROJECT/Structure.md +24 -0
- package/templates-app/beacon-isle-3d/docs/project-3d-rules.md +38 -0
- package/templates-app/beacon-isle-3d/generate-world.ts +814 -0
- package/templates-app/beacon-isle-3d/index.html +68 -0
- package/templates-app/beacon-isle-3d/package.json +26 -0
- package/templates-app/beacon-isle-3d/src/behaviors.ts +570 -0
- package/templates-app/beacon-isle-3d/src/game.scene.json +2992 -0
- package/templates-app/beacon-isle-3d/src/main.ts +33 -0
- package/templates-app/beacon-isle-3d/tsconfig.json +13 -0
- package/templates-app/beacon-isle-3d/verify.ts +285 -0
- package/templates-app/beacon-isle-3d/vite.config.ts +5 -0
- package/templates-app/tps-3d/PROJECT/Context.md +49 -0
- package/templates-app/tps-3d/PROJECT/Requirements.md +38 -0
- package/templates-app/tps-3d/PROJECT/Status.md +41 -0
- package/templates-app/tps-3d/PROJECT/Structure.md +44 -0
- package/templates-app/tps-3d/docs/project-3d-rules.md +38 -0
- package/templates-app/tps-3d/index.html +244 -0
- package/templates-app/tps-3d/package.json +25 -0
- package/templates-app/tps-3d/src/behaviors.ts +405 -0
- package/templates-app/tps-3d/src/game.scene.json +677 -0
- package/templates-app/tps-3d/src/main.ts +64 -0
- package/templates-app/tps-3d/tsconfig.json +13 -0
- package/templates-app/tps-3d/verify.ts +167 -0
- package/templates-app/tps-3d/vite.config.ts +5 -0
- package/templates-app/village-quest-3d/PROJECT/Context.md +39 -0
- package/templates-app/village-quest-3d/PROJECT/Requirements.md +36 -0
- package/templates-app/village-quest-3d/PROJECT/Status.md +26 -0
- package/templates-app/village-quest-3d/PROJECT/Structure.md +30 -0
- package/templates-app/village-quest-3d/docs/project-3d-rules.md +38 -0
- package/templates-app/village-quest-3d/index.html +68 -0
- package/templates-app/village-quest-3d/package.json +25 -0
- package/templates-app/village-quest-3d/src/behaviors.ts +529 -0
- package/templates-app/village-quest-3d/src/grove.scene.json +826 -0
- package/templates-app/village-quest-3d/src/main.ts +35 -0
- package/templates-app/village-quest-3d/src/quest.ts +18 -0
- package/templates-app/village-quest-3d/src/village.scene.json +680 -0
- package/templates-app/village-quest-3d/tsconfig.json +13 -0
- package/templates-app/village-quest-3d/verify.ts +254 -0
- package/templates-app/village-quest-3d/vite.config.ts +5 -0
package/dist/net.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as loadScene } from "./loader-
|
|
2
|
-
import { u as Engine } from "./register-
|
|
1
|
+
import { n as loadScene } from "./loader-BZqOKfI2.js";
|
|
2
|
+
import { u as Engine } from "./register-nObreUQR.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { t as jsonClone } from "./json-BLk7H2Qa.js";
|
|
5
5
|
import { n as createAgent8Server } from "./agent8-CvsfVskX.js";
|
|
6
|
-
import { i as applySyncPatch, n as NetworkSpawner, r as NetworkManager, t as registerNodesNet } from "./register-
|
|
6
|
+
import { i as applySyncPatch, n as NetworkSpawner, r as NetworkManager, t as registerNodesNet } from "./register-BFFE1Mh1.js";
|
|
7
7
|
//#region src/net/loopback.ts
|
|
8
8
|
/**
|
|
9
9
|
* In-memory multiplayer hub implementing the SAME kernel contract as
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as Node, P as Listener, l as PropSchema } from "./behavior-
|
|
1
|
+
import { $ as Node, P as Listener, l as PropSchema } from "./behavior-CPibUfnH.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/nodes/audio-player.d.ts
|
|
4
4
|
/**
|
|
@@ -107,4 +107,31 @@ declare class AudioPlayer extends Node {
|
|
|
107
107
|
override update(_dt: number): void;
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
|
-
|
|
110
|
+
//#region src/core/pathfinding.d.ts
|
|
111
|
+
/**
|
|
112
|
+
* Grid A* — the pathfinding every top-down/RPG/tower-defense asks for and
|
|
113
|
+
* agents keep re-inventing badly. Pure and dimension-free: cells in, cells
|
|
114
|
+
* out; the caller maps cells to world units (px, meters, tiles).
|
|
115
|
+
*/
|
|
116
|
+
interface PathGrid {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
/** True = impassable. Out-of-bounds is always solid. */
|
|
120
|
+
solid(x: number, y: number): boolean;
|
|
121
|
+
}
|
|
122
|
+
interface FindPathOptions {
|
|
123
|
+
/** Allow diagonal steps (blocked from cutting corners). Default true. */
|
|
124
|
+
diagonal?: boolean;
|
|
125
|
+
/** Abort guard for huge/impossible searches. Default 20000 nodes. */
|
|
126
|
+
maxExpansions?: number;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A* from `from` to `to` (inclusive cell coords). Returns the cell path
|
|
130
|
+
* INCLUDING both endpoints, or null when unreachable. Straight steps cost
|
|
131
|
+
* 1, diagonals √2; the heuristic is octile (admissible for both modes).
|
|
132
|
+
*/
|
|
133
|
+
declare function findPath(grid: PathGrid, from: [number, number], to: [number, number], opts?: FindPathOptions): [number, number][] | null;
|
|
134
|
+
/** Build a PathGrid from row-strings ('#' = solid) — tests and tile games. */
|
|
135
|
+
declare function gridFromRows(rows: readonly string[]): PathGrid;
|
|
136
|
+
//#endregion
|
|
137
|
+
export { AudioElementLike as a, gridFromRows as i, PathGrid as n, AudioPlayer as o, findPath as r, SpatialPose as s, FindPathOptions as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
|
-
import { _ as RigidBody2D, b as validateCollider2D, g as PhysicsBody2D, h as CharacterBody2D, m as Area2D, p as Joint2D, y as Node2D } from "./register-
|
|
3
|
+
import { _ as RigidBody2D, b as validateCollider2D, g as PhysicsBody2D, h as CharacterBody2D, m as Area2D, p as Joint2D, y as Node2D } from "./register-Djwckzgx.js";
|
|
4
4
|
import { n as registerDebugSource } from "./debug-draw-CZmOYjL2.js";
|
|
5
5
|
//#region src/2d/physics/physics-2d.ts
|
|
6
6
|
var physics_2d_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -16,7 +16,7 @@ const DEG = Math.PI / 180;
|
|
|
16
16
|
*/
|
|
17
17
|
async function enablePhysics2D(engine, opts) {
|
|
18
18
|
const R = await import("@dimforge/rapier2d-compat");
|
|
19
|
-
await R.init();
|
|
19
|
+
await R.init({});
|
|
20
20
|
return new Physics2D(R, engine, opts);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -99,8 +99,12 @@ var Physics2D = class {
|
|
|
99
99
|
const b = this.byColliderHandle.get(h2);
|
|
100
100
|
if (!a || !b) return;
|
|
101
101
|
const sig = started ? "triggerEnter" : "triggerExit";
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
try {
|
|
103
|
+
a.emit(sig, b);
|
|
104
|
+
b.emit(sig, a);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error(`incanto: error in a '${sig}' handler (${a.name} ↔ ${b.name}):`, error);
|
|
107
|
+
}
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
/** @internal Called by CharacterBody2D.moveAndSlide (during tree fixedUpdate). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
3
3
|
import { n as registerDebugSource } from "./debug-draw-CZmOYjL2.js";
|
|
4
|
-
import { A as
|
|
4
|
+
import { A as Area3D, F as Node3D, I as validateCollider3D, M as PhysicsBody3D, N as RigidBody3D, T as Terrain3D, j as CharacterBody3D, k as Joint3D } from "./register-BFw4c83z.js";
|
|
5
5
|
import { Euler, Quaternion } from "three";
|
|
6
6
|
//#region src/3d/physics/physics-3d.ts
|
|
7
7
|
var physics_3d_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -16,7 +16,7 @@ const DEG = Math.PI / 180;
|
|
|
16
16
|
*/
|
|
17
17
|
async function enablePhysics3D(engine, opts) {
|
|
18
18
|
const R = await import("@dimforge/rapier3d-compat");
|
|
19
|
-
await R.init();
|
|
19
|
+
await R.init({});
|
|
20
20
|
return new Physics3D(R, engine, opts);
|
|
21
21
|
}
|
|
22
22
|
/** Per-engine 3D physics world. Same contract as Physics2D. */
|
|
@@ -124,8 +124,12 @@ var Physics3D = class {
|
|
|
124
124
|
const b = this.byColliderHandle.get(h2);
|
|
125
125
|
if (!a || !b) return;
|
|
126
126
|
const sig = started ? "triggerEnter" : "triggerExit";
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
try {
|
|
128
|
+
a.emit(sig, b);
|
|
129
|
+
b.emit(sig, a);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error(`incanto: error in a '${sig}' handler (${a.name} ↔ ${b.name}):`, error);
|
|
132
|
+
}
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
135
|
/** @internal Called by CharacterBody3D.moveAndSlide (during tree fixedUpdate). */
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as JsonValue } from "./schema-CcoWb32N.js";
|
|
2
|
-
import { n as BehaviorCtor, v as Engine, w as Scene } from "./behavior-
|
|
2
|
+
import { n as BehaviorCtor, v as Engine, w as Scene } from "./behavior-CPibUfnH.js";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/react/index.d.ts
|
package/dist/react.js
CHANGED
|
@@ -156,7 +156,7 @@ function IncantoCanvas(props) {
|
|
|
156
156
|
pointer: latest.pointer,
|
|
157
157
|
...keyboard !== void 0 ? { keyboard } : {}
|
|
158
158
|
};
|
|
159
|
-
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-
|
|
159
|
+
const next = await (_gameFactory ?? (mode === "3d" ? async (o) => (await import("./create-game-J6g4QInv.js").then((n) => n.n)).createGame3D(o) : async (o) => (await import("./create-game-Ct86zczq.js").then((n) => n.n)).createGame2D(o)))(opts);
|
|
160
160
|
if (disposed) {
|
|
161
161
|
next.dispose();
|
|
162
162
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as Node, t as buildNodeJson, y as Signal } from "./loader-
|
|
2
|
-
import { t as registerCoreNodes } from "./register-
|
|
1
|
+
import { f as Node, t as buildNodeJson, y as Signal } from "./loader-BZqOKfI2.js";
|
|
2
|
+
import { t as registerCoreNodes } from "./register-nObreUQR.js";
|
|
3
3
|
import { t as IncantoError } from "./errors-BpWbnbb_.js";
|
|
4
4
|
import { n as jsonEquals, t as jsonClone } from "./json-BLk7H2Qa.js";
|
|
5
5
|
import { l as registerNode } from "./registry-BVJ2HbCn.js";
|