incanto 0.12.0 → 0.14.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 +219 -82
- package/dist/3d.js +74 -4
- package/dist/{behavior-Bod1AyJS.d.ts → behavior-CPibUfnH.d.ts} +4 -2
- package/dist/{create-game-C_xf4gm9.js → create-game-Ct86zczq.js} +5 -5
- package/dist/{create-game-B2fewJUy.js → create-game-OSntcIiM.js} +5 -5
- 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 -3
- 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/{pathfinding-BSiXjd6W.d.ts → pathfinding-RWYkNKx9.d.ts} +1 -1
- package/dist/{physics-2d-B6D864oZ.js → physics-2d-BiIdl51r.js} +2 -2
- package/dist/{physics-3d-RLNaxRyw.js → physics-3d-D_kUdOjr.js} +2 -2
- 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-C9-16x_t.js} +562 -157
- 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-D_4QY8Aq.js → agent8-BDC4LhjC.js} +1 -1
- package/editor/assets/{index-s0DZuroe.js → index-7qOYg7t8.js} +74 -74
- package/editor/index.html +1 -1
- package/package.json +4 -2
- package/schemas/scene.schema.json +266 -6
- package/skills/incanto-3d-character.md +35 -0
- package/skills/incanto-building-3d-games.md +48 -0
- package/skills/incanto-environment.md +15 -16
- package/skills/incanto-gameplay-behaviors.md +23 -1
- package/skills/incanto-node-reference.md +54 -3
- 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 +812 -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 +2969 -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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emberwood — a 3D quest vignette showcasing the 0.8 engine surface.
|
|
3
|
+
* Talk to the Elder (UiDialogue + choices), take the quest, sprint through the
|
|
4
|
+
* north gate (goToScene fade) into a hedge-maze grove where three wolves walk
|
|
5
|
+
* A* patrol rings (findPath + PathFollow), fell them with a sword arc
|
|
6
|
+
* (Trail3D), and report back. Wind is a live synth voice (startVoice) that
|
|
7
|
+
* rises as you run; the character animates through the controller's
|
|
8
|
+
* declarative `animations` map — zero animation code.
|
|
9
|
+
*/
|
|
10
|
+
import { assetUrls, preloadUrls } from 'incanto';
|
|
11
|
+
import { createGame3D } from 'incanto/3d';
|
|
12
|
+
import { BEHAVIORS } from './behaviors';
|
|
13
|
+
import villageJson from './village.scene.json';
|
|
14
|
+
|
|
15
|
+
const fill = document.querySelector('#progress') as HTMLElement | null;
|
|
16
|
+
const text = document.querySelector('#progress-text') as HTMLElement | null;
|
|
17
|
+
await preloadUrls(assetUrls(villageJson.assets), (done, total) => {
|
|
18
|
+
const pct = total > 0 ? Math.round((done / total) * 100) : 100;
|
|
19
|
+
if (fill) fill.style.width = `${pct}%`;
|
|
20
|
+
if (text) text.textContent = `${pct}%`;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const canvas = document.querySelector('canvas') as HTMLCanvasElement;
|
|
24
|
+
const game = await createGame3D({
|
|
25
|
+
debug: import.meta.env.VITE_INCANTO_DEBUG === '1',
|
|
26
|
+
canvas,
|
|
27
|
+
scene: villageJson,
|
|
28
|
+
behaviors: BEHAVIORS,
|
|
29
|
+
pointer: true, // pointer-lock look (click the canvas)
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
document.querySelector('#loading')?.remove();
|
|
33
|
+
|
|
34
|
+
// Console-poking handle for playtesting ("teleport me to the elder").
|
|
35
|
+
(window as unknown as { game: typeof game }).game = game;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-scene quest state. `goToScene` swaps the node tree but the module
|
|
3
|
+
* lives for the whole page — the natural home for "what has the player done".
|
|
4
|
+
*/
|
|
5
|
+
export const quest = {
|
|
6
|
+
/** The Elder asked; the grove gate opens. */
|
|
7
|
+
accepted: false,
|
|
8
|
+
/** All wolves down; report back. */
|
|
9
|
+
cleared: false,
|
|
10
|
+
/** Reported back; quest complete. */
|
|
11
|
+
done: false,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function resetQuest(): void {
|
|
15
|
+
quest.accepted = false;
|
|
16
|
+
quest.cleared = false;
|
|
17
|
+
quest.done = false;
|
|
18
|
+
}
|