@waica/archetype-isometric 0.11.0 → 0.12.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/dist/index.d.ts CHANGED
@@ -4,12 +4,15 @@ export { ISOMETRIC_BUNDLE } from './bundle.js';
4
4
  export { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
5
5
  export { ISOMETRIC_PREFABS, ISOMETRIC_HERO_SPRITE } from './prefabs.js';
6
6
  export { ISOMETRIC_ART_URLS, ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY, } from './registry.js';
7
- export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
7
+ export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_CAVE_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
8
8
  export { ISOMETRIC_UI } from './ui.js';
9
9
  export declare const ARCHETYPE: {
10
10
  id: string;
11
11
  label: string;
12
12
  scene: import("@waica/engine").SceneJson;
13
+ extraScenes: {
14
+ cave: import("@waica/engine").SceneJson;
15
+ };
13
16
  blankScene: import("@waica/engine").SceneJson;
14
17
  palette: import("@waica/engine").EntityTemplate[];
15
18
  prefabs: Record<string, import("@waica/engine").PrefabJson>;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ export { ISOMETRIC_BUNDLE } from './bundle.js';
6
6
  export { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
7
7
  export { ISOMETRIC_PREFABS, ISOMETRIC_HERO_SPRITE } from './prefabs.js';
8
8
  export { ISOMETRIC_ART_URLS, ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY, } from './registry.js';
9
- export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
9
+ export { ISOMETRIC_BLANK_SCENE, ISOMETRIC_CAVE_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
10
10
  export { ISOMETRIC_UI } from './ui.js';
11
11
  export const ARCHETYPE = {
12
12
  ...DATA_ARCHETYPE,
@@ -3,6 +3,9 @@ export declare const ARCHETYPE: {
3
3
  id: string;
4
4
  label: string;
5
5
  scene: import("@waica/engine").SceneJson;
6
+ extraScenes: {
7
+ cave: import("@waica/engine").SceneJson;
8
+ };
6
9
  blankScene: import("@waica/engine").SceneJson;
7
10
  registry: import("@waica/engine").SceneRegistry;
8
11
  palette: import("@waica/engine").EntityTemplate[];
package/dist/manifest.js CHANGED
@@ -4,7 +4,7 @@ import { ISOMETRIC_BUNDLE } from './bundle.js';
4
4
  import { ISOMETRIC_ACTION_LABELS, ISOMETRIC_BINDINGS } from './controls.js';
5
5
  import { ISOMETRIC_PREFABS } from './prefabs.js';
6
6
  import { ISOMETRIC_PALETTE, ISOMETRIC_REGISTRY_DATA } from './registry-data.js';
7
- import { ISOMETRIC_BLANK_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
7
+ import { ISOMETRIC_BLANK_SCENE, ISOMETRIC_CAVE_SCENE, ISOMETRIC_SCENE } from './scene-default.js';
8
8
  export const ISOMETRIC_ENTITY_ICONS = {
9
9
  IsoMotor: '🧭',
10
10
  Tilemap: '💎',
@@ -12,11 +12,13 @@ export const ISOMETRIC_ENTITY_ICONS = {
12
12
  Interactable: '💬',
13
13
  Collectible: '📦',
14
14
  Hazard: '👹',
15
+ SceneTransition: '🚪',
15
16
  };
16
17
  export const ARCHETYPE = {
17
18
  id: 'isometric',
18
19
  label: 'Isometric',
19
20
  scene: ISOMETRIC_SCENE,
21
+ extraScenes: { cave: ISOMETRIC_CAVE_SCENE },
20
22
  blankScene: ISOMETRIC_BLANK_SCENE,
21
23
  registry: ISOMETRIC_REGISTRY_DATA,
22
24
  palette: ISOMETRIC_PALETTE,
package/dist/prefabs.d.ts CHANGED
@@ -18,5 +18,9 @@ export declare const ISOMETRIC_HERO_SPRITE: {
18
18
  clips: ClipMap;
19
19
  initialClip: string;
20
20
  };
21
+ /** The second demo scene's ground: smaller and enclosed, so it reads as a distinct map. */
22
+ export declare const ISOMETRIC_CAVE_MAP_WIDTH = 10;
23
+ export declare const ISOMETRIC_CAVE_MAP_HEIGHT = 10;
24
+ export declare const ISOMETRIC_CAVE_GROUND_CELLS: number[];
21
25
  export declare const ISOMETRIC_PREFABS: Record<string, PrefabJson>;
22
26
  export {};
package/dist/prefabs.js CHANGED
@@ -67,6 +67,19 @@ function tileAt(column, row) {
67
67
  return GRASS;
68
68
  }
69
69
  const GROUND_CELLS = Array.from({ length: MAP_WIDTH * MAP_HEIGHT }, (_, index) => tileAt(index % MAP_WIDTH, Math.floor(index / MAP_WIDTH)));
70
+ /** The second demo scene's ground: smaller and enclosed, so it reads as a distinct map. */
71
+ export const ISOMETRIC_CAVE_MAP_WIDTH = 10;
72
+ export const ISOMETRIC_CAVE_MAP_HEIGHT = 10;
73
+ function caveTileAt(column, row) {
74
+ const width = ISOMETRIC_CAVE_MAP_WIDTH;
75
+ const height = ISOMETRIC_CAVE_MAP_HEIGHT;
76
+ if (column === 0 || row === 0 || column === width - 1 || row === height - 1)
77
+ return BORDER;
78
+ if (column >= 4 && column <= 5 && row >= 4 && row <= 5)
79
+ return WATER;
80
+ return DIRT;
81
+ }
82
+ export const ISOMETRIC_CAVE_GROUND_CELLS = Array.from({ length: ISOMETRIC_CAVE_MAP_WIDTH * ISOMETRIC_CAVE_MAP_HEIGHT }, (_, index) => caveTileAt(index % ISOMETRIC_CAVE_MAP_WIDTH, Math.floor(index / ISOMETRIC_CAVE_MAP_WIDTH)));
70
83
  export const ISOMETRIC_PREFABS = {
71
84
  'characters/player': {
72
85
  waicaPrefab: 1,
@@ -195,6 +208,24 @@ export const ISOMETRIC_PREFABS = {
195
208
  { type: 'Solid', props: { width: 0.8, height: 0.6 } },
196
209
  ],
197
210
  },
211
+ 'objects/door': {
212
+ waicaPrefab: 1,
213
+ type: 'object',
214
+ components: [
215
+ {
216
+ type: 'Sprite',
217
+ props: {
218
+ texture: 'waica:iso-rock',
219
+ pixelArt: true,
220
+ width: 1,
221
+ height: 1,
222
+ anchorY: 0,
223
+ },
224
+ },
225
+ { type: 'Hitbox', props: { width: 0.8, height: 0.8 } },
226
+ { type: 'SceneTransition', props: { scene: 'cave' } },
227
+ ],
228
+ },
198
229
  'tiles/ground': {
199
230
  waicaPrefab: 1,
200
231
  type: 'tile',
@@ -1,5 +1,5 @@
1
1
  import { AnimatedSprite, Hitbox, Solid, Sprite, StateMachine, Tilemap, } from '@waica/engine';
2
- import { Chaser, ClickToMove, Collectible, Hazard, Health, Interactable, IsoMotor, Lifetime, MeleeAttack, Patrol, Respawnable, } from '@waica/behaviors';
2
+ import { Chaser, ClickToMove, Collectible, Hazard, Health, Interactable, IsoMotor, Lifetime, MeleeAttack, Patrol, Respawnable, SceneTransition, } from '@waica/behaviors';
3
3
  import { ISOMETRIC_ART } from './art.js';
4
4
  import { ISOMETRIC_PREFABS } from './prefabs.js';
5
5
  import { ISOMETRIC_UI } from './ui.js';
@@ -23,6 +23,7 @@ export const ISOMETRIC_REGISTRY_DATA = {
23
23
  Respawnable,
24
24
  Lifetime,
25
25
  ClickToMove,
26
+ SceneTransition,
26
27
  },
27
28
  resolveAsset: (uri) => PACKAGE_ASSETS[uri] ?? uri,
28
29
  prefabs: ISOMETRIC_PREFABS,
@@ -3,3 +3,12 @@ import type { SceneJson } from '@waica/engine';
3
3
  export declare const ISOMETRIC_SCENE: SceneJson;
4
4
  /** Blank projects retain the diamond grid and full-map framing. */
5
5
  export declare const ISOMETRIC_BLANK_SCENE: SceneJson;
6
+ /**
7
+ * The second demo scene (CA-13): a smaller, enclosed cave — reusing
8
+ * `tiles/ground`'s texture with a distinct, smaller layout (an
9
+ * entity-level Tilemap override, no new asset) so it reads as a different
10
+ * map at a glance. The incoming Player is authored here, not carried from
11
+ * `main` (grill decision 18): crossing back through the Door lands at this
12
+ * scene's own entry, not beside where the player left.
13
+ */
14
+ export declare const ISOMETRIC_CAVE_SCENE: SceneJson;
@@ -1,3 +1,4 @@
1
+ import { ISOMETRIC_CAVE_GROUND_CELLS, ISOMETRIC_CAVE_MAP_HEIGHT, ISOMETRIC_CAVE_MAP_WIDTH, } from './prefabs.js';
1
2
  /**
2
3
  * Full-map framing plus a follow feel tuned for the diamond: a tight dead
3
4
  * zone and no horizontal lookahead (the engine's step kicks in every time
@@ -47,6 +48,12 @@ export const ISOMETRIC_SCENE = {
47
48
  { name: 'Tree-3', prefab: 'objects/tree', position: [12, 3] },
48
49
  { name: 'Rock-1', prefab: 'objects/rock', position: [5, 11] },
49
50
  { name: 'Rock-2', prefab: 'objects/rock', position: [9, 4] },
51
+ // The Scene Transition into the second demo scene: tucked in the
52
+ // north-west corner, well clear of every other prop, of the player's
53
+ // start-area walking radius, and of the click-to-move destinations the
54
+ // isometric e2e leg exercises (CA-13) — a Door placed inside any of
55
+ // those previously fired mid-test.
56
+ { name: 'Door', prefab: 'objects/door', position: [2, 2] },
50
57
  ],
51
58
  ui: ['crate-counter', 'health'],
52
59
  };
@@ -57,3 +64,46 @@ export const ISOMETRIC_BLANK_SCENE = {
57
64
  camera: isometricCamera(),
58
65
  entities: [],
59
66
  };
67
+ /**
68
+ * The second demo scene (CA-13): a smaller, enclosed cave — reusing
69
+ * `tiles/ground`'s texture with a distinct, smaller layout (an
70
+ * entity-level Tilemap override, no new asset) so it reads as a different
71
+ * map at a glance. The incoming Player is authored here, not carried from
72
+ * `main` (grill decision 18): crossing back through the Door lands at this
73
+ * scene's own entry, not beside where the player left.
74
+ */
75
+ export const ISOMETRIC_CAVE_SCENE = {
76
+ waicaScene: 3,
77
+ render: { sort: 'y', projection: 'isometric' },
78
+ camera: {
79
+ ...isometricCamera(),
80
+ position: [0, -5],
81
+ limits: { minX: -10, maxX: 10, minY: -10, maxY: 0 },
82
+ follow: 'Player',
83
+ },
84
+ entities: [
85
+ {
86
+ name: 'Ground',
87
+ prefab: 'tiles/ground',
88
+ position: [0, 0],
89
+ overrides: {
90
+ Tilemap: {
91
+ mapWidth: ISOMETRIC_CAVE_MAP_WIDTH,
92
+ mapHeight: ISOMETRIC_CAVE_MAP_HEIGHT,
93
+ cells: ISOMETRIC_CAVE_GROUND_CELLS,
94
+ },
95
+ },
96
+ },
97
+ { name: 'Player', prefab: 'characters/player', position: [2, 7] },
98
+ { name: 'Rock-1', prefab: 'objects/rock', position: [7, 3] },
99
+ { name: 'Rock-2', prefab: 'objects/rock', position: [2, 2] },
100
+ // Returns to the meadow, clear of the cave's rocks and water pool.
101
+ {
102
+ name: 'Door',
103
+ prefab: 'objects/door',
104
+ position: [8, 2],
105
+ overrides: { SceneTransition: { scene: 'main' } },
106
+ },
107
+ ],
108
+ ui: ['health'],
109
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waica/archetype-isometric",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Waica isometric archetype — logical-grid action adventures with screen-relative movement",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@waica/behaviors": "^0.11.0",
28
- "@waica/engine": "^0.11.0"
27
+ "@waica/behaviors": "^0.12.0",
28
+ "@waica/engine": "^0.12.0"
29
29
  }
30
30
  }