@waica/archetype-topdown 0.20.0 → 0.22.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.
@@ -1,5 +1,5 @@
1
1
  import type { InputBindings } from '@waica/engine';
2
- /** Top-down actions: four directions plus interact, arrows and WASD. */
2
+ /** Top-down actions: four directions plus interact; arrows and WASD, the left stick, D-pad and A (ADR 0023). */
3
3
  export declare const TOPDOWN_BINDINGS: Readonly<InputBindings>;
4
4
  /** Friendly labels shown by the editor's controls panel. */
5
5
  export declare const TOPDOWN_ACTION_LABELS: Readonly<Record<string, string>>;
package/dist/controls.js CHANGED
@@ -1,10 +1,10 @@
1
- /** Top-down actions: four directions plus interact, arrows and WASD. */
1
+ /** Top-down actions: four directions plus interact; arrows and WASD, the left stick, D-pad and A (ADR 0023). */
2
2
  export const TOPDOWN_BINDINGS = {
3
- up: ['ArrowUp', 'KeyW'],
4
- down: ['ArrowDown', 'KeyS'],
5
- left: ['ArrowLeft', 'KeyA'],
6
- right: ['ArrowRight', 'KeyD'],
7
- interact: ['KeyE', 'Space'],
3
+ up: ['ArrowUp', 'KeyW', 'Gamepad:LeftStickUp', 'Gamepad:DPadUp'],
4
+ down: ['ArrowDown', 'KeyS', 'Gamepad:LeftStickDown', 'Gamepad:DPadDown'],
5
+ left: ['ArrowLeft', 'KeyA', 'Gamepad:LeftStickLeft', 'Gamepad:DPadLeft'],
6
+ right: ['ArrowRight', 'KeyD', 'Gamepad:LeftStickRight', 'Gamepad:DPadRight'],
7
+ interact: ['KeyE', 'Space', 'Gamepad:A'],
8
8
  };
9
9
  /** Friendly labels shown by the editor's controls panel. */
10
10
  export const TOPDOWN_ACTION_LABELS = {
package/dist/prefabs.js CHANGED
@@ -1,5 +1,26 @@
1
1
  import { NPC_STATE_GRAPH, TOPDOWN_PLAYER_STATE_GRAPH } from '@waica/behaviors';
2
2
  import { HERO_SPRITE } from './scene-default.js';
3
+ /** The hero's walking dust: faint puffs left behind, drifting up and fading. */
4
+ const WALK_DUST = {
5
+ rate: 16,
6
+ emitting: false,
7
+ lifetime: 0.6,
8
+ positionSpread: [0.2, 0.08],
9
+ velocity: [0, 0.25],
10
+ velocitySpread: [0.35, 0.2],
11
+ space: 'world',
12
+ seed: 13,
13
+ capacity: 48,
14
+ width: 0.16,
15
+ height: 0.16,
16
+ startScale: 0.8,
17
+ endScale: 1.8,
18
+ startColor: 0xe0cfa8,
19
+ endColor: 0xb8a888,
20
+ startAlpha: 0.45,
21
+ endAlpha: 0,
22
+ layer: -0.5,
23
+ };
3
24
  /**
4
25
  * The archetype's reusable entity templates, keyed by ref ('tiles/tree').
5
26
  * Scenes reference these and override per-entity props; the palette derives
@@ -30,6 +51,11 @@ export const TOPDOWN_PREFABS = {
30
51
  },
31
52
  { type: 'Respawnable' },
32
53
  { type: 'Health', props: { max: 3, invulnerability: 1 } },
54
+ // A soft dust trail: a continuous emitter authored with
55
+ // emitting: false, switched on by DustTrail only while walking.
56
+ // Layer -0.5 sits between the ground tiles and the characters.
57
+ { type: 'ParticleEmitter', props: WALK_DUST },
58
+ { type: 'DustTrail', props: { state: 'walk' } },
33
59
  ],
34
60
  },
35
61
  'characters/villager': {
@@ -1,5 +1,5 @@
1
1
  import { AnimatedSprite, Hitbox, ParticleEmitter, Solid, Sprite, StateMachine, Tilemap, } from '@waica/engine';
2
- import { Chaser, ClickToMove, Collectible, Hazard, Health, Interactable, Lifetime, Patrol, Respawnable, SceneTransition, TopDownMotor, } from '@waica/behaviors';
2
+ import { Chaser, ClickToMove, Collectible, DustTrail, Hazard, Health, Interactable, Lifetime, Patrol, Respawnable, SceneTransition, TopDownMotor, } from '@waica/behaviors';
3
3
  import { TOPDOWN_ART } from './art.js';
4
4
  import { TOPDOWN_PREFABS } from './prefabs.js';
5
5
  import { TOPDOWN_UI } from './ui.js';
@@ -19,6 +19,7 @@ export const TOPDOWN_REGISTRY_DATA = {
19
19
  Hitbox,
20
20
  StateMachine,
21
21
  TopDownMotor,
22
+ DustTrail,
22
23
  Interactable,
23
24
  Collectible,
24
25
  Patrol,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waica/archetype-topdown",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Waica top-down archetype — opinionated setup for Zelda-like overhead adventures",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@waica/behaviors": "^0.20.0",
28
- "@waica/engine": "^0.20.0"
27
+ "@waica/behaviors": "^0.22.0",
28
+ "@waica/engine": "^0.22.0"
29
29
  }
30
30
  }