incanto 0.77.0 → 0.78.1

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 (71) hide show
  1. package/README.md +9 -4
  2. package/dist/index.js +1 -1
  3. package/dist/{src-DygJfhOb.js → src-SWXe-bub.js} +1 -1
  4. package/dist/vite.js +1 -1
  5. package/package.json +1 -1
  6. package/skills/incanto-building-2d-games.md +6 -0
  7. package/skills/incanto-building-3d-games.md +6 -0
  8. package/skills/incanto-editor.md +2 -2
  9. package/skills/incanto-multiplayer.md +1 -1
  10. package/skills/incanto-save-slots.md +1 -1
  11. package/skills/incanto-scene-json-authoring.md +1 -1
  12. package/skills/incanto-verifying-your-game.md +2 -2
  13. package/skills/incanto-web-integration.md +40 -2
  14. package/skills/incanto-your-first-game.md +6 -1
  15. package/templates-app/beacon-isle-3d/PROJECT/Structure.md +2 -1
  16. package/templates-app/beacon-isle-3d/index.html +5 -2
  17. package/templates-app/beacon-isle-3d/package.json +6 -1
  18. package/templates-app/beacon-isle-3d/src/App.tsx +77 -0
  19. package/templates-app/beacon-isle-3d/src/main.tsx +9 -0
  20. package/templates-app/beacon-isle-3d/tsconfig.json +2 -1
  21. package/templates-app/beacon-isle-3d/vite.config.ts +4 -1
  22. package/templates-app/molehill-2d/PROJECT/Structure.md +2 -1
  23. package/templates-app/molehill-2d/index.html +5 -2
  24. package/templates-app/molehill-2d/package.json +6 -1
  25. package/templates-app/molehill-2d/src/App.tsx +58 -0
  26. package/templates-app/molehill-2d/src/main.tsx +9 -0
  27. package/templates-app/molehill-2d/tsconfig.json +2 -1
  28. package/templates-app/molehill-2d/vite.config.ts +4 -1
  29. package/templates-app/platformer-2d/PROJECT/Context.md +1 -1
  30. package/templates-app/platformer-2d/PROJECT/Requirements.md +2 -2
  31. package/templates-app/platformer-2d/PROJECT/Status.md +1 -1
  32. package/templates-app/platformer-2d/PROJECT/Structure.md +2 -2
  33. package/templates-app/platformer-2d/docs/project-2d-rules.md +1 -1
  34. package/templates-app/platformer-2d/index.html +5 -2
  35. package/templates-app/platformer-2d/package.json +6 -1
  36. package/templates-app/platformer-2d/src/App.tsx +115 -0
  37. package/templates-app/platformer-2d/src/main.tsx +9 -0
  38. package/templates-app/platformer-2d/tsconfig.json +2 -1
  39. package/templates-app/platformer-2d/vite.config.ts +4 -1
  40. package/templates-app/star-survivor/PROJECT/Context.md +1 -1
  41. package/templates-app/star-survivor/PROJECT/Requirements.md +1 -1
  42. package/templates-app/star-survivor/PROJECT/Status.md +1 -1
  43. package/templates-app/star-survivor/PROJECT/Structure.md +2 -2
  44. package/templates-app/star-survivor/docs/project-2d-rules.md +1 -1
  45. package/templates-app/star-survivor/index.html +5 -2
  46. package/templates-app/star-survivor/package.json +6 -1
  47. package/templates-app/star-survivor/src/App.tsx +94 -0
  48. package/templates-app/star-survivor/src/main.tsx +9 -0
  49. package/templates-app/star-survivor/tsconfig.json +2 -1
  50. package/templates-app/star-survivor/vite.config.ts +4 -1
  51. package/templates-app/tps-3d/PROJECT/Status.md +1 -1
  52. package/templates-app/tps-3d/PROJECT/Structure.md +2 -2
  53. package/templates-app/tps-3d/index.html +5 -2
  54. package/templates-app/tps-3d/package.json +6 -1
  55. package/templates-app/tps-3d/src/App.tsx +124 -0
  56. package/templates-app/tps-3d/src/main.tsx +9 -0
  57. package/templates-app/tps-3d/tsconfig.json +2 -1
  58. package/templates-app/tps-3d/vite.config.ts +4 -1
  59. package/templates-app/village-quest-3d/PROJECT/Structure.md +3 -2
  60. package/templates-app/village-quest-3d/index.html +5 -2
  61. package/templates-app/village-quest-3d/package.json +6 -1
  62. package/templates-app/village-quest-3d/src/App.tsx +79 -0
  63. package/templates-app/village-quest-3d/src/main.tsx +9 -0
  64. package/templates-app/village-quest-3d/tsconfig.json +2 -1
  65. package/templates-app/village-quest-3d/vite.config.ts +4 -1
  66. package/templates-app/beacon-isle-3d/src/main.ts +0 -60
  67. package/templates-app/molehill-2d/src/main.ts +0 -41
  68. package/templates-app/platformer-2d/src/main.ts +0 -97
  69. package/templates-app/star-survivor/src/main.ts +0 -77
  70. package/templates-app/tps-3d/src/main.ts +0 -107
  71. package/templates-app/village-quest-3d/src/main.ts +0 -62
@@ -1,62 +0,0 @@
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, showBootFailure } 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
- /** Dev-only surfaces: the ☰ debug overlay, and the editor behind it. */
25
- const DEBUG = import.meta.env.VITE_INCANTO_DEBUG === '1';
26
-
27
- const game = await createGame3D({
28
- debug: DEBUG,
29
- // The editor's 📚 buttons, served by `incantoLibrary()` in vite.config.ts.
30
- // BOTH halves are the opt-in, and this half was missing from every shipped
31
- // template: the plugin alone left a vite config whose own comment promised
32
- // "the agent8 asset catalog behind the 📚 buttons" and no button anywhere.
33
- // Gated on the same flag, because `editor` DEFAULTS to `debug` and an object
34
- // here would turn the editor on in a production build.
35
- editor: DEBUG && { library: true },
36
- canvas,
37
- scene: villageJson,
38
- behaviors: BEHAVIORS,
39
- pointer: true, // pointer-lock look (click the canvas)
40
- }).catch((e) => {
41
- // Without this the player watches the loading overlay sit at 100% forever:
42
- // `#loading` is removed on the line below, so anything that rejects here (no
43
- // WebGL context, a scene that will not load) leaves the bar up and the reason
44
- // in a console nobody opens.
45
- showBootFailure(e);
46
- throw e;
47
- });
48
-
49
- // The console handle FIRST, before any wiring of your own can throw.
50
- // `game.stats()`, `game.assetErrors()`, `game.frame()` and `game.engine.log`
51
- // are the entire in-page diagnostic surface, and a static build has no other.
52
- // Assigned after the wiring, one mistake below took all of them with it.
53
- (window as unknown as { game: typeof game }).game = game;
54
-
55
- // The overlay comes down LAST, after any wiring of your own. There is none in
56
- // this template — when you add some, put it above this line and wrap it:
57
- //
58
- // try { …your wiring… } catch (e) { showBootFailure(e); throw e; }
59
- //
60
- // A throw between the overlay coming down and the handle going up used to leave
61
- // a level that renders perfectly with no player and no error of any kind.
62
- document.querySelector('#loading')?.remove();