@waica/archetype-isometric 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.
@@ -105,3 +105,32 @@ remain at the human-approved 16 texels per render unit.
105
105
  - Placeholder-quality by design: exact visual polish is out of scope for
106
106
  this run and is the human-verified part of CA-8/CA-12 — a human is free
107
107
  to swap this file for a nicer diamond later without touching any code.
108
+
109
+ ## Audio
110
+
111
+ All four sound files are Creative Commons Zero (CC0). The three effects ship
112
+ byte-for-byte as distributed; only the music was re-encoded (see below).
113
+
114
+ ### Sound effects
115
+
116
+ - **RPG Audio** and **Impact Sounds** by Kenney Vleugels (Kenney.nl)
117
+ - Sources: https://kenney.nl/assets/rpg-audio and
118
+ https://kenney.nl/assets/impact-sounds
119
+ - Licence shown by each pack's `License.txt`: **Creative Commons Zero, CC0**.
120
+ Kenney states: "Credit (Kenney or www.kenney.nl) would be nice but is not
121
+ mandatory."
122
+ - `waica-iso-sword-swing.ogg` is `knifeSlice.ogg` from RPG Audio.
123
+ - `waica-iso-hit.ogg` is `chop.ogg` from RPG Audio.
124
+ - `waica-iso-hurt.ogg` is `impactPunch_medium_000.ogg` from Impact Sounds.
125
+
126
+ ### Music
127
+
128
+ - **Town Theme RPG** by cynicmusic
129
+ - Source: https://opengameart.org/content/town-theme-rpg
130
+ - Licence shown by the submission page: **CC0**. The author asks for
131
+ `cynicmusic.com pixelsphere.org` as credit, which CC0 does not require and
132
+ this file gives anyway.
133
+ - `waica-iso-town-theme.ogg` is the pack's `TownTheme.mp3` re-encoded to Ogg
134
+ Vorbis (`ffmpeg -c:a vorbis -q:a 3 -ar 44100`), 97.5 s, no edits to the
135
+ audio itself. Vorbis rather than Opus so the file plays on the Safari 16.4+
136
+ baseline the spec commits to; Opus in Ogg needs Safari 17.
Binary file
Binary file
Binary file
Binary file
package/dist/art.js CHANGED
@@ -1,11 +1,15 @@
1
1
  /** Stock art as Node-safe package data. */
2
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
- { file: 'waica-iso-click-marker.png', uri: 'waica:iso-click-marker' },
3
+ { file: 'waica-iso-hero.png', uri: 'waica:iso-hero', kind: 'image' },
4
+ { file: 'waica-iso-villager.png', uri: 'waica:iso-villager', kind: 'image' },
5
+ { file: 'waica-iso-orc.png', uri: 'waica:iso-orc', kind: 'image' },
6
+ { file: 'waica-iso-ground.png', uri: 'waica:iso-ground', kind: 'image' },
7
+ { file: 'waica-iso-tree.png', uri: 'waica:iso-tree', kind: 'image' },
8
+ { file: 'waica-iso-rock.png', uri: 'waica:iso-rock', kind: 'image' },
9
+ { file: 'waica-iso-crate.png', uri: 'waica:iso-crate', kind: 'image' },
10
+ { file: 'waica-iso-click-marker.png', uri: 'waica:iso-click-marker', kind: 'image' },
11
+ { file: 'waica-iso-sword-swing.ogg', uri: 'waica:iso-sword-swing', kind: 'sound' },
12
+ { file: 'waica-iso-hit.ogg', uri: 'waica:iso-hit', kind: 'sound' },
13
+ { file: 'waica-iso-hurt.ogg', uri: 'waica:iso-hurt', kind: 'sound' },
14
+ { file: 'waica-iso-town-theme.ogg', uri: 'waica:iso-town-theme', kind: 'sound' },
11
15
  ];
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>;
@@ -19,6 +22,7 @@ export declare const ARCHETYPE: {
19
22
  actionLabels: Readonly<Record<string, string>>;
20
23
  bundle: import("@waica/engine").ArchetypeBundle;
21
24
  animation: import("@waica/engine").DirectionalAnimation<string>;
25
+ music: string;
22
26
  registry: import("@waica/engine").SceneRegistry;
23
27
  artUrls: Record<string, string>;
24
28
  };
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[];
@@ -13,4 +16,5 @@ export declare const ARCHETYPE: {
13
16
  actionLabels: Readonly<Record<string, string>>;
14
17
  bundle: import("@waica/engine").ArchetypeBundle;
15
18
  animation: import("@waica/engine").DirectionalAnimation<string>;
19
+ music: string;
16
20
  };
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,
@@ -27,4 +29,7 @@ export const ARCHETYPE = {
27
29
  actionLabels: ISOMETRIC_ACTION_LABELS,
28
30
  bundle: ISOMETRIC_BUNDLE,
29
31
  animation: ISOMETRIC_ANIMATION,
32
+ // G8: the archetype's own looping music bed. The generic project
33
+ // template (and examples/isometric/src/main.ts) start it if present.
34
+ music: 'waica:iso-town-theme',
30
35
  };
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,
@@ -83,9 +96,12 @@ export const ISOMETRIC_PREFABS = {
83
96
  },
84
97
  },
85
98
  { type: 'Hitbox', props: { width: 0.8, height: 0.8 } },
86
- { type: 'MeleeAttack' },
99
+ { type: 'MeleeAttack', props: { swingSound: 'waica:iso-sword-swing' } },
87
100
  { type: 'Respawnable' },
88
- { type: 'Health', props: { max: 3, invulnerability: 1, stat: 'health' } },
101
+ {
102
+ type: 'Health',
103
+ props: { max: 3, invulnerability: 1, stat: 'health', hurtSound: 'waica:iso-hurt' },
104
+ },
89
105
  {
90
106
  type: 'ClickToMove',
91
107
  props: {
@@ -140,7 +156,7 @@ export const ISOMETRIC_PREFABS = {
140
156
  },
141
157
  { type: 'Hitbox', props: { width: 0.8, height: 0.7 } },
142
158
  { type: 'Hazard', props: { stompable: false, contactDamage: 1 } },
143
- { type: 'Health', props: { max: 2, invulnerability: 0.3 } },
159
+ { type: 'Health', props: { max: 2, invulnerability: 0.3, hurtSound: 'waica:iso-hit' } },
144
160
  ],
145
161
  },
146
162
  'objects/crate': {
@@ -195,6 +211,24 @@ export const ISOMETRIC_PREFABS = {
195
211
  { type: 'Solid', props: { width: 0.8, height: 0.6 } },
196
212
  ],
197
213
  },
214
+ 'objects/door': {
215
+ waicaPrefab: 1,
216
+ type: 'object',
217
+ components: [
218
+ {
219
+ type: 'Sprite',
220
+ props: {
221
+ texture: 'waica:iso-rock',
222
+ pixelArt: true,
223
+ width: 1,
224
+ height: 1,
225
+ anchorY: 0,
226
+ },
227
+ },
228
+ { type: 'Hitbox', props: { width: 0.8, height: 0.8 } },
229
+ { type: 'SceneTransition', props: { scene: 'cave' } },
230
+ ],
231
+ },
198
232
  'tiles/ground': {
199
233
  waicaPrefab: 1,
200
234
  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,
package/dist/registry.js CHANGED
@@ -10,6 +10,10 @@ export const ISOMETRIC_ART_URLS = {
10
10
  'waica-iso-rock.png': new URL('../assets/waica-iso-rock.png', import.meta.url).href,
11
11
  'waica-iso-crate.png': new URL('../assets/waica-iso-crate.png', import.meta.url).href,
12
12
  'waica-iso-click-marker.png': new URL('../assets/waica-iso-click-marker.png', import.meta.url).href,
13
+ 'waica-iso-sword-swing.ogg': new URL('../assets/waica-iso-sword-swing.ogg', import.meta.url).href,
14
+ 'waica-iso-hit.ogg': new URL('../assets/waica-iso-hit.ogg', import.meta.url).href,
15
+ 'waica-iso-hurt.ogg': new URL('../assets/waica-iso-hurt.ogg', import.meta.url).href,
16
+ 'waica-iso-town-theme.ogg': new URL('../assets/waica-iso-town-theme.ogg', import.meta.url).href,
13
17
  };
14
18
  const BUILTIN_ASSETS = Object.fromEntries(ISOMETRIC_ART.map((art) => [art.uri, ISOMETRIC_ART_URLS[art.file] ?? art.uri]));
15
19
  export const ISOMETRIC_REGISTRY = {
@@ -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.13.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.13.0",
28
+ "@waica/engine": "^0.13.0"
29
29
  }
30
30
  }