@waica/cli 0.6.1 → 0.8.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.
Files changed (151) hide show
  1. package/README.md +1 -1
  2. package/dist/editor/assets/{cssMode-D3SZSKEA.js → cssMode-DwPoqXFO.js} +1 -1
  3. package/dist/editor/assets/{freemarker2-BH1pa3TU.js → freemarker2-gl5y25bH.js} +1 -1
  4. package/dist/editor/assets/{handlebars-Cf7meNHo.js → handlebars-DHUb8mb3.js} +1 -1
  5. package/dist/editor/assets/{html-6hqYzl5P.js → html-C8W-psr4.js} +1 -1
  6. package/dist/editor/assets/{htmlMode-D_IiyUdi.js → htmlMode-BiF5TH2_.js} +1 -1
  7. package/dist/editor/assets/{index-Cy5pmBhN.css → index-CzarIYLW.css} +1 -1
  8. package/dist/editor/assets/{index-CJyB1cBF.js → index-DtMwWp8R.js} +6380 -2495
  9. package/dist/editor/assets/{javascript-CTeTqLj8.js → javascript-D_t2jyWi.js} +1 -1
  10. package/dist/editor/assets/{jsonMode-t8AC-38H.js → jsonMode-CZ0SltDj.js} +1 -1
  11. package/dist/editor/assets/{liquid-Dc6NoKas.js → liquid-DUxURZui.js} +1 -1
  12. package/dist/editor/assets/{mdx-DCPtX-bs.js → mdx-CDIQ7hmo.js} +1 -1
  13. package/dist/editor/assets/{python-DXAju_oJ.js → python-Cra2N916.js} +1 -1
  14. package/dist/editor/assets/{razor-DqQldpv6.js → razor-B3qV-mNp.js} +1 -1
  15. package/dist/editor/assets/{tsMode-B60EhHlZ.js → tsMode-Ci457z4v.js} +1 -1
  16. package/dist/editor/assets/{typescript-C4LyYAns.js → typescript-BXjh3GLT.js} +1 -1
  17. package/dist/editor/assets/{xml-B0QcT5_Z.js → xml-DQuEpqk5.js} +1 -1
  18. package/dist/editor/assets/{yaml-CEpyO2Qc.js → yaml-CQA7WIT-.js} +1 -1
  19. package/dist/editor/index.html +2 -2
  20. package/dist/mcp/archetypes.js +6 -2
  21. package/dist/mcp/create-project.js +12 -6
  22. package/dist/mcp/known-archetypes.js +24 -0
  23. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/ATTRIBUTION.md +72 -0
  24. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-crate.png +0 -0
  25. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-ground.png +0 -0
  26. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-hero.png +0 -0
  27. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-orc.png +0 -0
  28. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-rock.png +0 -0
  29. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-tree.png +0 -0
  30. package/dist/mcp/node_modules/@waica/archetype-isometric/assets/waica-iso-villager.png +0 -0
  31. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/animation.d.ts +3 -0
  32. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/animation.js +10 -0
  33. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/art.d.ts +3 -0
  34. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/art.js +10 -0
  35. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/bundle.d.ts +2 -0
  36. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/bundle.js +9 -0
  37. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/controls.d.ts +3 -0
  38. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/controls.js +14 -0
  39. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/index.d.ts +24 -0
  40. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/index.js +15 -0
  41. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/manifest.d.ts +16 -0
  42. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/manifest.js +29 -0
  43. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/prefabs.d.ts +18 -0
  44. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/prefabs.js +196 -0
  45. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry-data.d.ts +3 -0
  46. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry-data.js +46 -0
  47. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry.d.ts +4 -0
  48. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/registry.js +17 -0
  49. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/scene-default.d.ts +5 -0
  50. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/scene-default.js +49 -0
  51. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/ui.d.ts +1 -0
  52. package/dist/mcp/node_modules/@waica/archetype-isometric/dist/ui.js +17 -0
  53. package/dist/mcp/node_modules/@waica/archetype-isometric/package.json +30 -0
  54. package/dist/mcp/node_modules/@waica/archetype-platformer/package.json +3 -3
  55. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/ATTRIBUTION.md +28 -0
  56. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-blob.png +0 -0
  57. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-fence.png +0 -0
  58. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-grass.png +0 -0
  59. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-hero.png +0 -0
  60. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-npc.png +0 -0
  61. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-path.png +0 -0
  62. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-potion.png +0 -0
  63. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-tree.png +0 -0
  64. package/dist/mcp/node_modules/@waica/archetype-topdown/assets/waica-water.png +0 -0
  65. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/animation.d.ts +7 -0
  66. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/animation.js +10 -0
  67. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/art.d.ts +10 -0
  68. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/art.js +19 -0
  69. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/bundle.d.ts +3 -0
  70. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/bundle.js +10 -0
  71. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/controls.d.ts +5 -0
  72. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/controls.js +16 -0
  73. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/index.d.ts +25 -0
  74. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/index.js +16 -0
  75. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/manifest.d.ts +16 -0
  76. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/manifest.js +29 -0
  77. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/prefabs.d.ts +11 -0
  78. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/prefabs.js +178 -0
  79. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/registry-data.d.ts +9 -0
  80. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/registry-data.js +55 -0
  81. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/registry.d.ts +6 -0
  82. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/registry.js +21 -0
  83. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/scene-default.d.ts +57 -0
  84. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/scene-default.js +110 -0
  85. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/ui.d.ts +10 -0
  86. package/dist/mcp/node_modules/@waica/archetype-topdown/dist/ui.js +26 -0
  87. package/dist/mcp/node_modules/@waica/archetype-topdown/package.json +30 -0
  88. package/dist/mcp/node_modules/@waica/behaviors/dist/grid-motor.d.ts +56 -0
  89. package/dist/mcp/node_modules/@waica/behaviors/dist/grid-motor.js +74 -0
  90. package/dist/mcp/node_modules/@waica/behaviors/dist/grid-player-role.d.ts +15 -0
  91. package/dist/mcp/node_modules/@waica/behaviors/dist/grid-player-role.js +71 -0
  92. package/dist/mcp/node_modules/@waica/behaviors/dist/index.d.ts +5 -0
  93. package/dist/mcp/node_modules/@waica/behaviors/dist/index.js +5 -0
  94. package/dist/mcp/node_modules/@waica/behaviors/dist/interactable.d.ts +34 -0
  95. package/dist/mcp/node_modules/@waica/behaviors/dist/interactable.js +72 -0
  96. package/dist/mcp/node_modules/@waica/behaviors/dist/iso-motor.d.ts +14 -0
  97. package/dist/mcp/node_modules/@waica/behaviors/dist/iso-motor.js +36 -0
  98. package/dist/mcp/node_modules/@waica/behaviors/dist/iso-player-states.d.ts +5 -0
  99. package/dist/mcp/node_modules/@waica/behaviors/dist/iso-player-states.js +9 -0
  100. package/dist/mcp/node_modules/@waica/behaviors/dist/platformer-motor.d.ts +4 -2
  101. package/dist/mcp/node_modules/@waica/behaviors/dist/platformer-motor.js +5 -1
  102. package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-motor.d.ts +18 -0
  103. package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-motor.js +31 -0
  104. package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-player-states.d.ts +5 -0
  105. package/dist/mcp/node_modules/@waica/behaviors/dist/topdown-player-states.js +14 -0
  106. package/dist/mcp/node_modules/@waica/behaviors/package.json +2 -2
  107. package/dist/mcp/node_modules/@waica/engine/dist/animation/directional.d.ts +48 -0
  108. package/dist/mcp/node_modules/@waica/engine/dist/animation/directional.js +68 -0
  109. package/dist/mcp/node_modules/@waica/engine/dist/archetype.d.ts +3 -0
  110. package/dist/mcp/node_modules/@waica/engine/dist/camera.d.ts +19 -0
  111. package/dist/mcp/node_modules/@waica/engine/dist/camera.js +10 -0
  112. package/dist/mcp/node_modules/@waica/engine/dist/component.d.ts +2 -0
  113. package/dist/mcp/node_modules/@waica/engine/dist/components/animated-sprite.d.ts +27 -2
  114. package/dist/mcp/node_modules/@waica/engine/dist/components/animated-sprite.js +50 -5
  115. package/dist/mcp/node_modules/@waica/engine/dist/components/dynamic-body.js +2 -4
  116. package/dist/mcp/node_modules/@waica/engine/dist/components/sprite.d.ts +23 -1
  117. package/dist/mcp/node_modules/@waica/engine/dist/components/sprite.js +49 -8
  118. package/dist/mcp/node_modules/@waica/engine/dist/components/tilemap.d.ts +113 -0
  119. package/dist/mcp/node_modules/@waica/engine/dist/components/tilemap.js +316 -0
  120. package/dist/mcp/node_modules/@waica/engine/dist/entity.d.ts +3 -0
  121. package/dist/mcp/node_modules/@waica/engine/dist/entity.js +13 -1
  122. package/dist/mcp/node_modules/@waica/engine/dist/game.d.ts +13 -1
  123. package/dist/mcp/node_modules/@waica/engine/dist/game.js +70 -9
  124. package/dist/mcp/node_modules/@waica/engine/dist/index.d.ts +16 -3
  125. package/dist/mcp/node_modules/@waica/engine/dist/index.js +8 -1
  126. package/dist/mcp/node_modules/@waica/engine/dist/projection.d.ts +14 -0
  127. package/dist/mcp/node_modules/@waica/engine/dist/projection.js +30 -0
  128. package/dist/mcp/node_modules/@waica/engine/dist/render-sort.d.ts +31 -0
  129. package/dist/mcp/node_modules/@waica/engine/dist/render-sort.js +39 -0
  130. package/dist/mcp/node_modules/@waica/engine/dist/scene-solids.d.ts +16 -0
  131. package/dist/mcp/node_modules/@waica/engine/dist/scene-solids.js +28 -0
  132. package/dist/mcp/node_modules/@waica/engine/dist/scene.d.ts +12 -0
  133. package/dist/mcp/node_modules/@waica/engine/dist/scene.js +1 -0
  134. package/dist/mcp/node_modules/@waica/engine/dist/solid-axis.js +2 -4
  135. package/dist/mcp/node_modules/@waica/engine/dist/sprite-placement.d.ts +22 -0
  136. package/dist/mcp/node_modules/@waica/engine/dist/sprite-placement.js +14 -0
  137. package/dist/mcp/node_modules/@waica/engine/dist/state/hooks.d.ts +1 -1
  138. package/dist/mcp/node_modules/@waica/engine/dist/state/hooks.js +3 -1
  139. package/dist/mcp/node_modules/@waica/engine/dist/state/state-machine.d.ts +18 -0
  140. package/dist/mcp/node_modules/@waica/engine/dist/state/state-machine.js +57 -1
  141. package/dist/mcp/node_modules/@waica/engine/dist/tilemap-grid.d.ts +26 -0
  142. package/dist/mcp/node_modules/@waica/engine/dist/tilemap-grid.js +41 -0
  143. package/dist/mcp/node_modules/@waica/engine/package.json +1 -1
  144. package/dist/mcp/package-resolver.js +14 -4
  145. package/dist/mcp/project-component-loader.js +2 -1
  146. package/dist/mcp/project-component-runner.js +5 -0
  147. package/dist/mcp/server.js +18 -1
  148. package/dist/mcp/template/package.json.tpl +1 -1
  149. package/dist/mcp/template/src/main.ts +8 -4
  150. package/dist/mcp/workspace-runtime.js +41 -10
  151. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import type { DirectionalAnimation } from '@waica/engine';
2
+ /** Five authored facings plus three horizontal mirror fallbacks. */
3
+ export declare const ISOMETRIC_ANIMATION: DirectionalAnimation;
@@ -0,0 +1,10 @@
1
+ /** Five authored facings plus three horizontal mirror fallbacks. */
2
+ export const ISOMETRIC_ANIMATION = {
3
+ directions: ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'],
4
+ fallbacks: {
5
+ w: { dir: 'e', flip: true },
6
+ nw: { dir: 'ne', flip: true },
7
+ sw: { dir: 'se', flip: true },
8
+ },
9
+ contract: { required: ['idle'], fallbacks: { walk: 'idle' } },
10
+ };
@@ -0,0 +1,3 @@
1
+ import type { ArchetypeArt } from '@waica/engine';
2
+ /** Stock art as Node-safe package data. */
3
+ export declare const ISOMETRIC_ART: ArchetypeArt[];
@@ -0,0 +1,10 @@
1
+ /** Stock art as Node-safe package data. */
2
+ export const ISOMETRIC_ART = [
3
+ { file: 'waica-iso-hero.png', uri: 'waica:iso-hero' },
4
+ { file: 'waica-iso-villager.png', uri: 'waica:iso-villager' },
5
+ { file: 'waica-iso-orc.png', uri: 'waica:iso-orc' },
6
+ { file: 'waica-iso-ground.png', uri: 'waica:iso-ground' },
7
+ { file: 'waica-iso-tree.png', uri: 'waica:iso-tree' },
8
+ { file: 'waica-iso-rock.png', uri: 'waica:iso-rock' },
9
+ { file: 'waica-iso-crate.png', uri: 'waica:iso-crate' },
10
+ ];
@@ -0,0 +1,2 @@
1
+ import type { ArchetypeBundle } from '@waica/engine';
2
+ export declare const ISOMETRIC_BUNDLE: ArchetypeBundle;
@@ -0,0 +1,9 @@
1
+ import { CHASER_ROLE, ISO_PLAYER_ROLE, NPC_ROLE, PATROLLER_ROLE, } from '@waica/behaviors';
2
+ export const ISOMETRIC_BUNDLE = {
3
+ roles: {
4
+ player: ISO_PLAYER_ROLE,
5
+ patroller: PATROLLER_ROLE,
6
+ chaser: CHASER_ROLE,
7
+ npc: NPC_ROLE,
8
+ },
9
+ };
@@ -0,0 +1,3 @@
1
+ import type { InputBindings } from '@waica/engine';
2
+ export declare const ISOMETRIC_BINDINGS: Readonly<InputBindings>;
3
+ export declare const ISOMETRIC_ACTION_LABELS: Readonly<Record<string, string>>;
@@ -0,0 +1,14 @@
1
+ export const ISOMETRIC_BINDINGS = {
2
+ up: ['ArrowUp', 'KeyW'],
3
+ down: ['ArrowDown', 'KeyS'],
4
+ left: ['ArrowLeft', 'KeyA'],
5
+ right: ['ArrowRight', 'KeyD'],
6
+ interact: ['KeyE', 'Space'],
7
+ };
8
+ export const ISOMETRIC_ACTION_LABELS = {
9
+ up: 'Move up',
10
+ down: 'Move down',
11
+ left: 'Move left',
12
+ right: 'Move right',
13
+ interact: 'Interact',
14
+ };
@@ -0,0 +1,24 @@
1
+ export { ISOMETRIC_ANIMATION } from './animation.js';
2
+ export { ISOMETRIC_ART } from './art.js';
3
+ export { ISOMETRIC_BUNDLE } from './bundle.js';
4
+ export { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
5
+ export { ISOMETRIC_PREFABS, ISOMETRIC_HERO_SPRITE } from './prefabs.js';
6
+ export { ISOMETRIC_ART_URLS, ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY, } from './registry.js';
7
+ export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
8
+ export { ISOMETRIC_UI } from './ui.js';
9
+ export declare const ARCHETYPE: {
10
+ id: string;
11
+ label: string;
12
+ scene: import("@waica/engine").SceneJson;
13
+ blankScene: import("@waica/engine").SceneJson;
14
+ palette: import("@waica/engine").EntityTemplate[];
15
+ prefabs: Record<string, import("@waica/engine").PrefabJson>;
16
+ art: import("@waica/engine").ArchetypeArt[];
17
+ entityIcons: Readonly<Record<string, string>>;
18
+ bindings: Readonly<import("@waica/engine").InputBindings>;
19
+ actionLabels: Readonly<Record<string, string>>;
20
+ bundle: import("@waica/engine").ArchetypeBundle;
21
+ animation: import("@waica/engine").DirectionalAnimation<string>;
22
+ registry: import("@waica/engine").SceneRegistry;
23
+ artUrls: Record<string, string>;
24
+ };
@@ -0,0 +1,15 @@
1
+ import { ARCHETYPE as DATA_ARCHETYPE } from './manifest.js';
2
+ import { ISOMETRIC_ART_URLS, ISOMETRIC_REGISTRY } from './registry.js';
3
+ export { ISOMETRIC_ANIMATION } from './animation.js';
4
+ export { ISOMETRIC_ART } from './art.js';
5
+ export { ISOMETRIC_BUNDLE } from './bundle.js';
6
+ export { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
7
+ export { ISOMETRIC_PREFABS, ISOMETRIC_HERO_SPRITE } from './prefabs.js';
8
+ export { ISOMETRIC_ART_URLS, ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY, } from './registry.js';
9
+ export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
10
+ export { ISOMETRIC_UI } from './ui.js';
11
+ export const ARCHETYPE = {
12
+ ...DATA_ARCHETYPE,
13
+ registry: ISOMETRIC_REGISTRY,
14
+ artUrls: ISOMETRIC_ART_URLS,
15
+ };
@@ -0,0 +1,16 @@
1
+ export declare const ISOMETRIC_ENTITY_ICONS: Readonly<Record<string, string>>;
2
+ export declare const ARCHETYPE: {
3
+ id: string;
4
+ label: string;
5
+ scene: import("@waica/engine").SceneJson;
6
+ blankScene: import("@waica/engine").SceneJson;
7
+ registry: import("@waica/engine").SceneRegistry;
8
+ palette: import("@waica/engine").EntityTemplate[];
9
+ prefabs: Record<string, import("@waica/engine").PrefabJson>;
10
+ art: import("@waica/engine").ArchetypeArt[];
11
+ entityIcons: Readonly<Record<string, string>>;
12
+ bindings: Readonly<import("@waica/engine").InputBindings>;
13
+ actionLabels: Readonly<Record<string, string>>;
14
+ bundle: import("@waica/engine").ArchetypeBundle;
15
+ animation: import("@waica/engine").DirectionalAnimation<string>;
16
+ };
@@ -0,0 +1,29 @@
1
+ import { ISOMETRIC_ANIMATION } from './animation.js';
2
+ import { ISOMETRIC_ART } from './art.js';
3
+ import { ISOMETRIC_BUNDLE } from './bundle.js';
4
+ import { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
5
+ import { ISOMETRIC_PREFABS } from './prefabs.js';
6
+ import { ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY_DATA } from './registry-data.js';
7
+ import { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
8
+ export const ISOMETRIC_ENTITY_ICONS = {
9
+ IsoMotor: '🧭',
10
+ Tilemap: '💎',
11
+ Interactable: '💬',
12
+ Collectible: '📦',
13
+ Hazard: '👹',
14
+ };
15
+ export const ARCHETYPE = {
16
+ id: 'isometric',
17
+ label: 'Isometric',
18
+ scene: ISOMETRIC_SCENE,
19
+ blankScene: ISOMETRIC_BLANK_SCENE,
20
+ registry: ISOMETRIC_REGISTRY_DATA,
21
+ palette: ISOMETRIC_PALETTE,
22
+ prefabs: ISOMETRIC_PREFABS,
23
+ art: ISOMETRIC_ART,
24
+ entityIcons: ISOMETRIC_ENTITY_ICONS,
25
+ bindings: ISOMETRIC_BINDINGS,
26
+ actionLabels: ISOMETRIC_ACTION_LABELS,
27
+ bundle: ISOMETRIC_BUNDLE,
28
+ animation: ISOMETRIC_ANIMATION,
29
+ };
@@ -0,0 +1,18 @@
1
+ import type { PrefabJson } from '@waica/engine';
2
+ export declare const ISOMETRIC_HERO_SPRITE: {
3
+ texture: string;
4
+ cols: number;
5
+ rows: number;
6
+ spacingX: number;
7
+ spacingY: number;
8
+ pixelArt: boolean;
9
+ width: number;
10
+ height: number;
11
+ anchorY: number;
12
+ clips: Record<string, {
13
+ frames: number[];
14
+ fps: number;
15
+ }>;
16
+ initialClip: string;
17
+ };
18
+ export declare const ISOMETRIC_PREFABS: Record<string, PrefabJson>;
@@ -0,0 +1,196 @@
1
+ import { ISO_PLAYER_STATE_GRAPH, NPC_STATE_GRAPH, PATROLLER_STATE_GRAPH, } from '@waica/behaviors';
2
+ const SHIPPED_DIRECTIONS = ['n', 'ne', 'e', 'se', 's'];
3
+ function directionalClips(includePlain) {
4
+ const clips = {};
5
+ SHIPPED_DIRECTIONS.forEach((direction, row) => {
6
+ const first = row * 4;
7
+ clips[`idle-${direction}`] = { frames: [first], fps: 2 };
8
+ clips[`walk-${direction}`] = {
9
+ frames: [first + 1, first + 2, first + 3, first + 2],
10
+ fps: 8,
11
+ };
12
+ });
13
+ if (includePlain) {
14
+ clips['idle'] = { frames: [16], fps: 2 };
15
+ clips['walk'] = { frames: [17, 18, 19, 18], fps: 8 };
16
+ }
17
+ return clips;
18
+ }
19
+ function characterSprite(texture, includePlain = false) {
20
+ return {
21
+ texture,
22
+ cols: 4,
23
+ rows: 5,
24
+ spacingX: 1,
25
+ spacingY: 1,
26
+ pixelArt: true,
27
+ width: 2,
28
+ height: 2,
29
+ anchorY: 0,
30
+ clips: directionalClips(includePlain),
31
+ initialClip: includePlain ? 'idle' : 'idle-s',
32
+ };
33
+ }
34
+ export const ISOMETRIC_HERO_SPRITE = characterSprite('waica:iso-hero');
35
+ const MAP_WIDTH = 16;
36
+ const MAP_HEIGHT = 16;
37
+ const GRASS = 0;
38
+ const DIRT = 1;
39
+ const PATH = 2;
40
+ const WATER = 3;
41
+ const BORDER = 4;
42
+ function tileAt(column, row) {
43
+ if (column === 0 || row === 0 || column === MAP_WIDTH - 1 || row === MAP_HEIGHT - 1) {
44
+ return BORDER;
45
+ }
46
+ if (column >= 11 && column <= 12 && row >= 5 && row <= 6)
47
+ return WATER;
48
+ if (column === 7 || row === 7)
49
+ return PATH;
50
+ if (column >= 2 && column <= 5 && row >= 2 && row <= 4)
51
+ return DIRT;
52
+ return GRASS;
53
+ }
54
+ const GROUND_CELLS = Array.from({ length: MAP_WIDTH * MAP_HEIGHT }, (_, index) => tileAt(index % MAP_WIDTH, Math.floor(index / MAP_WIDTH)));
55
+ export const ISOMETRIC_PREFABS = {
56
+ 'characters/player': {
57
+ waicaPrefab: 1,
58
+ type: 'character',
59
+ components: [
60
+ { type: 'AnimatedSprite', props: ISOMETRIC_HERO_SPRITE },
61
+ { type: 'IsoMotor' },
62
+ {
63
+ type: 'StateMachine',
64
+ props: {
65
+ role: 'player',
66
+ initial: ISO_PLAYER_STATE_GRAPH.initial,
67
+ states: ISO_PLAYER_STATE_GRAPH.states,
68
+ },
69
+ },
70
+ { type: 'Hitbox', props: { width: 0.8, height: 0.8 } },
71
+ { type: 'Respawnable' },
72
+ { type: 'Health', props: { max: 3, invulnerability: 1 } },
73
+ ],
74
+ },
75
+ 'characters/villager': {
76
+ waicaPrefab: 1,
77
+ type: 'character',
78
+ components: [
79
+ {
80
+ type: 'AnimatedSprite',
81
+ props: characterSprite('waica:iso-villager', true),
82
+ },
83
+ {
84
+ type: 'StateMachine',
85
+ props: {
86
+ role: 'npc',
87
+ initial: NPC_STATE_GRAPH.initial,
88
+ states: NPC_STATE_GRAPH.states,
89
+ },
90
+ },
91
+ { type: 'Interactable', props: { line: 'Welcome to Diamond Meadow!', radius: 1.5 } },
92
+ { type: 'Solid', props: { width: 0.8, height: 0.6 } },
93
+ ],
94
+ },
95
+ 'characters/orc': {
96
+ waicaPrefab: 1,
97
+ type: 'character',
98
+ components: [
99
+ {
100
+ type: 'AnimatedSprite',
101
+ props: {
102
+ ...characterSprite('waica:iso-orc', true),
103
+ initialClip: 'walk',
104
+ },
105
+ },
106
+ { type: 'Patrol', props: { axis: 'horizontal', distance: 2, speed: 2 } },
107
+ {
108
+ type: 'StateMachine',
109
+ props: {
110
+ role: 'patroller',
111
+ initial: PATROLLER_STATE_GRAPH.initial,
112
+ states: PATROLLER_STATE_GRAPH.states,
113
+ },
114
+ },
115
+ { type: 'Hitbox', props: { width: 0.8, height: 0.7 } },
116
+ { type: 'Hazard', props: { stompable: false, contactDamage: 1 } },
117
+ ],
118
+ },
119
+ 'objects/crate': {
120
+ waicaPrefab: 1,
121
+ type: 'object',
122
+ components: [
123
+ {
124
+ type: 'Sprite',
125
+ props: {
126
+ texture: 'waica:iso-crate',
127
+ pixelArt: true,
128
+ width: 1,
129
+ height: 1,
130
+ anchorY: 0,
131
+ },
132
+ },
133
+ { type: 'Hitbox', props: { width: 0.6, height: 0.6 } },
134
+ { type: 'Collectible', props: { value: 1 } },
135
+ ],
136
+ },
137
+ 'objects/tree': {
138
+ waicaPrefab: 1,
139
+ type: 'object',
140
+ components: [
141
+ {
142
+ type: 'Sprite',
143
+ props: {
144
+ texture: 'waica:iso-tree',
145
+ pixelArt: true,
146
+ width: 2,
147
+ height: 47 / 16,
148
+ anchorY: 0,
149
+ },
150
+ },
151
+ { type: 'Solid', props: { width: 0.8, height: 0.6 } },
152
+ ],
153
+ },
154
+ 'objects/rock': {
155
+ waicaPrefab: 1,
156
+ type: 'object',
157
+ components: [
158
+ {
159
+ type: 'Sprite',
160
+ props: {
161
+ texture: 'waica:iso-rock',
162
+ pixelArt: true,
163
+ width: 1,
164
+ height: 1,
165
+ anchorY: 0,
166
+ },
167
+ },
168
+ { type: 'Solid', props: { width: 0.8, height: 0.6 } },
169
+ ],
170
+ },
171
+ 'tiles/ground': {
172
+ waicaPrefab: 1,
173
+ type: 'tile',
174
+ components: [
175
+ {
176
+ type: 'Tilemap',
177
+ props: {
178
+ texture: 'waica:iso-ground',
179
+ cols: 5,
180
+ rows: 1,
181
+ spacingX: 1,
182
+ spacingY: 1,
183
+ cellWidth: 64,
184
+ cellHeight: 32,
185
+ pixelArt: true,
186
+ mapWidth: MAP_WIDTH,
187
+ mapHeight: MAP_HEIGHT,
188
+ cellSize: 1,
189
+ cells: GROUND_CELLS,
190
+ solidTiles: [WATER, BORDER],
191
+ layer: -2,
192
+ },
193
+ },
194
+ ],
195
+ },
196
+ };
@@ -0,0 +1,3 @@
1
+ import { type EntityTemplate, type SceneRegistry } from '@waica/engine';
2
+ export declare const ISOMETRIC_REGISTRY_DATA: SceneRegistry;
3
+ export declare const ISOMETRIC_PALETTE: EntityTemplate[];
@@ -0,0 +1,46 @@
1
+ import { AnimatedSprite, Hitbox, Solid, Sprite, StateMachine, Tilemap, } from '@waica/engine';
2
+ import { Chaser, Collectible, Hazard, Health, Interactable, IsoMotor, Lifetime, Patrol, Respawnable, } from '@waica/behaviors';
3
+ import { ISOMETRIC_ART } from './art.js';
4
+ import { ISOMETRIC_PREFABS } from './prefabs.js';
5
+ import { ISOMETRIC_UI } from './ui.js';
6
+ const PACKAGE_ASSETS = Object.fromEntries(ISOMETRIC_ART.map((art) => [art.uri, `assets/${art.file}`]));
7
+ export const ISOMETRIC_REGISTRY_DATA = {
8
+ components: {
9
+ Sprite,
10
+ AnimatedSprite,
11
+ Tilemap,
12
+ Solid,
13
+ Hitbox,
14
+ StateMachine,
15
+ IsoMotor,
16
+ Interactable,
17
+ Collectible,
18
+ Patrol,
19
+ Chaser,
20
+ Hazard,
21
+ Health,
22
+ Respawnable,
23
+ Lifetime,
24
+ },
25
+ resolveAsset: (uri) => PACKAGE_ASSETS[uri] ?? uri,
26
+ prefabs: ISOMETRIC_PREFABS,
27
+ ui: ISOMETRIC_UI,
28
+ };
29
+ const PALETTE_ICONS = {
30
+ player: '🧭',
31
+ villager: '🧑‍🌾',
32
+ orc: '👹',
33
+ crate: '📦',
34
+ tree: '🌳',
35
+ rock: '🪨',
36
+ ground: '💎',
37
+ };
38
+ export const ISOMETRIC_PALETTE = Object.entries(ISOMETRIC_PREFABS).map(([key, prefab]) => {
39
+ const base = key.slice(key.indexOf('/') + 1);
40
+ return {
41
+ label: base,
42
+ icon: PALETTE_ICONS[base] ?? '▣',
43
+ category: prefab.type,
44
+ make: () => ({ name: base.charAt(0).toUpperCase() + base.slice(1), prefab: key }),
45
+ };
46
+ });
@@ -0,0 +1,4 @@
1
+ import type { SceneRegistry } from '@waica/engine';
2
+ export { ISOMETRIC_PALETTE } from './registry-data.js';
3
+ export declare const ISOMETRIC_ART_URLS: Record<string, string>;
4
+ export declare const ISOMETRIC_REGISTRY: SceneRegistry;
@@ -0,0 +1,17 @@
1
+ import { ISOMETRIC_ART } from './art.js';
2
+ import { ISOMETRIC_REGISTRY_DATA } from './registry-data.js';
3
+ export { ISOMETRIC_PALETTE } from './registry-data.js';
4
+ export const ISOMETRIC_ART_URLS = {
5
+ 'waica-iso-hero.png': new URL('../assets/waica-iso-hero.png', import.meta.url).href,
6
+ 'waica-iso-villager.png': new URL('../assets/waica-iso-villager.png', import.meta.url).href,
7
+ 'waica-iso-orc.png': new URL('../assets/waica-iso-orc.png', import.meta.url).href,
8
+ 'waica-iso-ground.png': new URL('../assets/waica-iso-ground.png', import.meta.url).href,
9
+ 'waica-iso-tree.png': new URL('../assets/waica-iso-tree.png', import.meta.url).href,
10
+ 'waica-iso-rock.png': new URL('../assets/waica-iso-rock.png', import.meta.url).href,
11
+ 'waica-iso-crate.png': new URL('../assets/waica-iso-crate.png', import.meta.url).href,
12
+ };
13
+ const BUILTIN_ASSETS = Object.fromEntries(ISOMETRIC_ART.map((art) => [art.uri, ISOMETRIC_ART_URLS[art.file] ?? art.uri]));
14
+ export const ISOMETRIC_REGISTRY = {
15
+ ...ISOMETRIC_REGISTRY_DATA,
16
+ resolveAsset: (uri) => BUILTIN_ASSETS[uri] ?? uri,
17
+ };
@@ -0,0 +1,5 @@
1
+ import type { SceneJson } from '@waica/engine';
2
+ /** A logical 16x16 meadow projected into a 2:1 diamond at render time. */
3
+ export declare const ISOMETRIC_SCENE: SceneJson;
4
+ /** Blank projects retain the diamond grid and full-map framing. */
5
+ export declare const ISOMETRIC_BLANK_SCENE: SceneJson;
@@ -0,0 +1,49 @@
1
+ function isometricCamera() {
2
+ return {
3
+ position: [0, -8],
4
+ zoom: 12,
5
+ limits: { minX: -16, maxX: 16, minY: -16, maxY: 0 },
6
+ };
7
+ }
8
+ /** A logical 16x16 meadow projected into a 2:1 diamond at render time. */
9
+ export const ISOMETRIC_SCENE = {
10
+ waicaScene: 3,
11
+ render: { sort: 'y', projection: 'isometric' },
12
+ camera: {
13
+ ...isometricCamera(),
14
+ follow: 'Player',
15
+ lookaheadY: 1,
16
+ },
17
+ entities: [
18
+ { name: 'Ground', prefab: 'tiles/ground', position: [0, 0] },
19
+ { name: 'Player', prefab: 'characters/player', position: [8, 8] },
20
+ {
21
+ name: 'Villager',
22
+ prefab: 'characters/villager',
23
+ position: [6, 9],
24
+ overrides: { Interactable: { line: 'The water sparkles, but it blocks the trail.' } },
25
+ },
26
+ {
27
+ name: 'Orc',
28
+ prefab: 'characters/orc',
29
+ position: [10, 10],
30
+ overrides: { Patrol: { axis: 'horizontal', distance: 2.5, speed: 1.5 } },
31
+ },
32
+ { name: 'Crate-1', prefab: 'objects/crate', position: [5, 6] },
33
+ { name: 'Crate-2', prefab: 'objects/crate', position: [10, 4] },
34
+ { name: 'Crate-3', prefab: 'objects/crate', position: [12, 10] },
35
+ { name: 'Tree-1', prefab: 'objects/tree', position: [4, 10] },
36
+ { name: 'Tree-2', prefab: 'objects/tree', position: [10, 12] },
37
+ { name: 'Tree-3', prefab: 'objects/tree', position: [12, 3] },
38
+ { name: 'Rock-1', prefab: 'objects/rock', position: [5, 11] },
39
+ { name: 'Rock-2', prefab: 'objects/rock', position: [9, 4] },
40
+ ],
41
+ ui: ['crate-counter'],
42
+ };
43
+ /** Blank projects retain the diamond grid and full-map framing. */
44
+ export const ISOMETRIC_BLANK_SCENE = {
45
+ waicaScene: 3,
46
+ render: { sort: 'y', projection: 'isometric' },
47
+ camera: isometricCamera(),
48
+ entities: [],
49
+ };
@@ -0,0 +1 @@
1
+ export declare const ISOMETRIC_UI: Record<string, string>;
@@ -0,0 +1,17 @@
1
+ import { INTERACTABLE_UI } from '@waica/behaviors';
2
+ export const ISOMETRIC_UI = {
3
+ 'crate-counter': `<style>
4
+ .crate-counter {
5
+ position: absolute;
6
+ top: 12px;
7
+ left: 12px;
8
+ font: 600 20px system-ui, sans-serif;
9
+ color: #ffd166;
10
+ text-shadow: 0 1px 3px #000a;
11
+ user-select: none;
12
+ }
13
+ </style>
14
+ <div class="crate-counter">📦 {{points}}</div>
15
+ `,
16
+ ...INTERACTABLE_UI,
17
+ };
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@waica/archetype-isometric",
3
+ "version": "0.8.0",
4
+ "description": "Waica isometric archetype — logical-grid action adventures with screen-relative movement",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/chichex/waica",
10
+ "directory": "packages/archetype-isometric"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "assets"
15
+ ],
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./manifest": {
22
+ "types": "./dist/manifest.d.ts",
23
+ "default": "./dist/manifest.js"
24
+ }
25
+ },
26
+ "dependencies": {
27
+ "@waica/behaviors": "^0.8.0",
28
+ "@waica/engine": "^0.8.0"
29
+ }
30
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waica/archetype-platformer",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Waica platformer archetype — opinionated setup for side-scrolling platformers",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@waica/behaviors": "^0.6.1",
28
- "@waica/engine": "^0.6.1"
27
+ "@waica/behaviors": "^0.8.0",
28
+ "@waica/engine": "^0.8.0"
29
29
  }
30
30
  }
@@ -0,0 +1,28 @@
1
+ # Art attribution
2
+
3
+ All sprites in this directory are composed from Creative Commons Zero (CC0)
4
+ pixel art by Kenney (www.kenney.nl). CC0 requires no attribution — this file
5
+ credits the source anyway and records exactly how each sheet was assembled,
6
+ so the composition is reproducible.
7
+
8
+ Sources (both CC0, downloaded 2026-08-10):
9
+
10
+ - **RPG Urban Pack 1.0** — https://kenney.nl/assets/rpg-urban-pack
11
+ (`Tilemap/tilemap_packed.png`, a 27×18 grid of 16×16 tiles)
12
+ - **Tiny Dungeon 1.0** — https://kenney.nl/assets/tiny-dungeon
13
+ (`Tilemap/tilemap_packed.png`, a 12×11 grid of 16×16 tiles)
14
+
15
+ Tile coordinates below are `(column, row)`, zero-based, into each pack's
16
+ `tilemap_packed.png`.
17
+
18
+ | File | Size | Source | Composition |
19
+ |---|---|---|---|
20
+ | `waica-hero.png` | 50×50 | RPG Urban | Character 1 (rows 0–2). 3×3 grid of 16×16 cells with 1px transparent gutters between them (frame-edge sampling never reaches a neighbour): rows = facing s/n/e (source columns 24/25/26), columns = idle / walk A / walk B (source rows base+0/1/2). West is mirrored from east at runtime. |
21
+ | `waica-npc.png` | 50×50 | RPG Urban | Character 4, the farmer (rows 9–11). Same 3×3 gutter layout as the hero. |
22
+ | `waica-blob.png` | 16×16 | Tiny Dungeon | (0, 9) — the green blob. |
23
+ | `waica-potion.png` | 16×16 | Tiny Dungeon | (7, 9) — the red potion. |
24
+ | `waica-grass.png` | 16×16 | RPG Urban | (1, 1) — plain grass. |
25
+ | `waica-water.png` | 16×16 | RPG Urban | (9, 7) — pond interior. |
26
+ | `waica-path.png` | 16×16 | Tiny Dungeon | (1, 4) — speckled sand. |
27
+ | `waica-fence.png` | 16×16 | Tiny Dungeon | (5, 6) — fence run. |
28
+ | `waica-tree.png` | 16×32 | RPG Urban | (16, 8)–(16, 9) — tall green tree, two tiles stacked. |
@@ -0,0 +1,7 @@
1
+ import type { DirectionalAnimation } from '@waica/engine';
2
+ /**
3
+ * The archetype's directional animation contract: four facings with west
4
+ * mirrored from east art (the stock sheets only draw s/n/e), clips named
5
+ * `<state>-<dir>`, and walk falling back to idle when a sheet lacks it.
6
+ */
7
+ export declare const TOPDOWN_ANIMATION: DirectionalAnimation;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The archetype's directional animation contract: four facings with west
3
+ * mirrored from east art (the stock sheets only draw s/n/e), clips named
4
+ * `<state>-<dir>`, and walk falling back to idle when a sheet lacks it.
5
+ */
6
+ export const TOPDOWN_ANIMATION = {
7
+ directions: ['n', 's', 'e', 'w'],
8
+ fallbacks: { w: { dir: 'e', flip: true } },
9
+ contract: { required: ['idle'], fallbacks: { walk: 'idle' } },
10
+ };