@waica/archetype-isometric 0.19.2 → 0.21.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/effect-prefabs.d.ts +29 -0
- package/dist/effect-prefabs.js +108 -0
- package/dist/prefabs.js +7 -0
- package/dist/registry-data.js +8 -2
- package/dist/scene-default.js +16 -0
- package/package.json +3 -3
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PrefabJson } from '@waica/engine';
|
|
2
|
+
/** The hero's sword-swing sparks: warm, short-lived, thrown up the screen and pulled back down. */
|
|
3
|
+
export declare const SWORD_SPARKS: {
|
|
4
|
+
rate: number;
|
|
5
|
+
lifetime: number;
|
|
6
|
+
positionSpread: number[];
|
|
7
|
+
velocity: number[];
|
|
8
|
+
velocitySpread: number[];
|
|
9
|
+
gravity: number[];
|
|
10
|
+
space: string;
|
|
11
|
+
seed: number;
|
|
12
|
+
capacity: number;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
startScale: number;
|
|
16
|
+
endScale: number;
|
|
17
|
+
startColor: number;
|
|
18
|
+
endColor: number;
|
|
19
|
+
startAlpha: number;
|
|
20
|
+
endAlpha: number;
|
|
21
|
+
blend: string;
|
|
22
|
+
layer: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The demo's particle effects as placeable objects: no sprite, only an
|
|
26
|
+
* emitter (plus DamagePuff for the hurt smoke). Scenes place them like any
|
|
27
|
+
* other prop, and the palette offers them.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ISOMETRIC_EFFECT_PREFABS: Record<string, PrefabJson>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/** The hero's sword-swing sparks: warm, short-lived, thrown up the screen and pulled back down. */
|
|
2
|
+
export const SWORD_SPARKS = {
|
|
3
|
+
rate: 0,
|
|
4
|
+
lifetime: 0.3,
|
|
5
|
+
positionSpread: [0.25, 0.25],
|
|
6
|
+
velocity: [-1.8, -1.8],
|
|
7
|
+
velocitySpread: [2.6, 2.6],
|
|
8
|
+
gravity: [3, 3],
|
|
9
|
+
space: 'world',
|
|
10
|
+
seed: 7,
|
|
11
|
+
capacity: 64,
|
|
12
|
+
width: 0.16,
|
|
13
|
+
height: 0.16,
|
|
14
|
+
startScale: 1,
|
|
15
|
+
endScale: 0.3,
|
|
16
|
+
startColor: 0xffc21a,
|
|
17
|
+
endColor: 0xff3a00,
|
|
18
|
+
startAlpha: 1,
|
|
19
|
+
endAlpha: 0,
|
|
20
|
+
blend: 'normal',
|
|
21
|
+
layer: 1,
|
|
22
|
+
};
|
|
23
|
+
/** Continuous wind streaks covering the whole 16x16 meadow from the scene's Wind position ([8, 6]). */
|
|
24
|
+
const WIND = {
|
|
25
|
+
rate: 22,
|
|
26
|
+
lifetime: 1.4,
|
|
27
|
+
positionSpread: [9, 10],
|
|
28
|
+
velocity: [2.2, -2.2],
|
|
29
|
+
velocitySpread: [0.4, 0.4],
|
|
30
|
+
space: 'world',
|
|
31
|
+
seed: 3,
|
|
32
|
+
capacity: 64,
|
|
33
|
+
width: 1.8,
|
|
34
|
+
height: 0.06,
|
|
35
|
+
startScale: 1,
|
|
36
|
+
endScale: 1.6,
|
|
37
|
+
startColor: 0xe8f4ff,
|
|
38
|
+
endColor: 0xe8f4ff,
|
|
39
|
+
startAlpha: 0.6,
|
|
40
|
+
endAlpha: 0,
|
|
41
|
+
layer: 0,
|
|
42
|
+
};
|
|
43
|
+
/** A burst-only grey puff rising off whatever took damage, drawn over the sprites. */
|
|
44
|
+
const HURT_SMOKE = {
|
|
45
|
+
rate: 0,
|
|
46
|
+
lifetime: 0.6,
|
|
47
|
+
positionSpread: [0.2, 0.2],
|
|
48
|
+
velocity: [-0.6, -0.6],
|
|
49
|
+
velocitySpread: [0.8, 0.8],
|
|
50
|
+
gravity: [0.4, 0.4],
|
|
51
|
+
space: 'world',
|
|
52
|
+
seed: 11,
|
|
53
|
+
capacity: 64,
|
|
54
|
+
width: 0.3,
|
|
55
|
+
height: 0.3,
|
|
56
|
+
startScale: 0.6,
|
|
57
|
+
endScale: 1.8,
|
|
58
|
+
startColor: 0xdddddd,
|
|
59
|
+
endColor: 0x777777,
|
|
60
|
+
startAlpha: 0.7,
|
|
61
|
+
endAlpha: 0,
|
|
62
|
+
layer: 1,
|
|
63
|
+
};
|
|
64
|
+
/** Slow, faint motes over the 10x10 cave's floor (inside its border ring) when placed at its center. */
|
|
65
|
+
const CAVE_DUST = {
|
|
66
|
+
rate: 5,
|
|
67
|
+
lifetime: 3,
|
|
68
|
+
positionSpread: [4, 4],
|
|
69
|
+
velocity: [-0.1, -0.1],
|
|
70
|
+
velocitySpread: [0.15, 0.15],
|
|
71
|
+
space: 'world',
|
|
72
|
+
seed: 5,
|
|
73
|
+
capacity: 32,
|
|
74
|
+
width: 0.12,
|
|
75
|
+
height: 0.12,
|
|
76
|
+
startScale: 1,
|
|
77
|
+
endScale: 0.5,
|
|
78
|
+
startColor: 0xfff0c8,
|
|
79
|
+
endColor: 0xfff0c8,
|
|
80
|
+
startAlpha: 0.7,
|
|
81
|
+
endAlpha: 0,
|
|
82
|
+
layer: 0,
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* The demo's particle effects as placeable objects: no sprite, only an
|
|
86
|
+
* emitter (plus DamagePuff for the hurt smoke). Scenes place them like any
|
|
87
|
+
* other prop, and the palette offers them.
|
|
88
|
+
*/
|
|
89
|
+
export const ISOMETRIC_EFFECT_PREFABS = {
|
|
90
|
+
'objects/wind': {
|
|
91
|
+
waicaPrefab: 1,
|
|
92
|
+
type: 'object',
|
|
93
|
+
components: [{ type: 'ParticleEmitter', props: WIND }],
|
|
94
|
+
},
|
|
95
|
+
'objects/hurt-smoke': {
|
|
96
|
+
waicaPrefab: 1,
|
|
97
|
+
type: 'object',
|
|
98
|
+
components: [
|
|
99
|
+
{ type: 'ParticleEmitter', props: HURT_SMOKE },
|
|
100
|
+
{ type: 'DamagePuff', props: { count: 10 } },
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
'objects/cave-dust': {
|
|
104
|
+
waicaPrefab: 1,
|
|
105
|
+
type: 'object',
|
|
106
|
+
components: [{ type: 'ParticleEmitter', props: CAVE_DUST }],
|
|
107
|
+
},
|
|
108
|
+
};
|
package/dist/prefabs.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISO_PLAYER_STATE_GRAPH, NPC_STATE_GRAPH, PATROLLER_STATE_GRAPH, } from '@waica/behaviors';
|
|
2
|
+
import { ISOMETRIC_EFFECT_PREFABS, SWORD_SPARKS } from './effect-prefabs.js';
|
|
2
3
|
const SHIPPED_DIRECTIONS = ['n', 'ne', 'e', 'se', 's'];
|
|
3
4
|
/** One row per shipped facing: idle · walk×3 · attack×3 · hurt×2 · death×2. */
|
|
4
5
|
const SHEET_COLUMNS = 11;
|
|
@@ -113,6 +114,11 @@ export const ISOMETRIC_PREFABS = {
|
|
|
113
114
|
markerHeight: 0.5,
|
|
114
115
|
},
|
|
115
116
|
},
|
|
117
|
+
// Sword sparks: a burst-only emitter SwingSparks fires on entering
|
|
118
|
+
// 'attack'. It draws on layer 1, over the y-sorted sprites, so the
|
|
119
|
+
// flash reads in front of the hero.
|
|
120
|
+
{ type: 'ParticleEmitter', props: SWORD_SPARKS },
|
|
121
|
+
{ type: 'SwingSparks', props: { state: 'attack', count: 18 } },
|
|
116
122
|
],
|
|
117
123
|
},
|
|
118
124
|
'characters/villager': {
|
|
@@ -231,6 +237,7 @@ export const ISOMETRIC_PREFABS = {
|
|
|
231
237
|
{ type: 'Solid', props: { width: 0.8, height: 0.6 } },
|
|
232
238
|
],
|
|
233
239
|
},
|
|
240
|
+
...ISOMETRIC_EFFECT_PREFABS,
|
|
234
241
|
'objects/door': {
|
|
235
242
|
waicaPrefab: 1,
|
|
236
243
|
type: 'object',
|
package/dist/registry-data.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnimatedSprite, Hitbox, Solid, Sprite, StateMachine, Tilemap, } from '@waica/engine';
|
|
2
|
-
import { Chaser, ClickToMove, Collectible, Hazard, Health, Interactable, IsoMotor, Lifetime, MeleeAttack, Patrol, Respawnable, SceneTransition, } from '@waica/behaviors';
|
|
1
|
+
import { AnimatedSprite, Hitbox, ParticleEmitter, Solid, Sprite, StateMachine, Tilemap, } from '@waica/engine';
|
|
2
|
+
import { Chaser, ClickToMove, Collectible, DamagePuff, Hazard, Health, Interactable, IsoMotor, Lifetime, MeleeAttack, Patrol, Respawnable, SceneTransition, SwingSparks, } 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';
|
|
@@ -8,12 +8,15 @@ export const ISOMETRIC_REGISTRY_DATA = {
|
|
|
8
8
|
components: {
|
|
9
9
|
Sprite,
|
|
10
10
|
AnimatedSprite,
|
|
11
|
+
ParticleEmitter,
|
|
11
12
|
Tilemap,
|
|
12
13
|
Solid,
|
|
13
14
|
Hitbox,
|
|
14
15
|
StateMachine,
|
|
15
16
|
IsoMotor,
|
|
16
17
|
MeleeAttack,
|
|
18
|
+
SwingSparks,
|
|
19
|
+
DamagePuff,
|
|
17
20
|
Interactable,
|
|
18
21
|
Collectible,
|
|
19
22
|
Patrol,
|
|
@@ -36,6 +39,9 @@ const PALETTE_ICONS = {
|
|
|
36
39
|
crate: '📦',
|
|
37
40
|
tree: '🌳',
|
|
38
41
|
rock: '🪨',
|
|
42
|
+
wind: '🌬️',
|
|
43
|
+
'hurt-smoke': '💨',
|
|
44
|
+
'cave-dust': '✨',
|
|
39
45
|
ground: '💎',
|
|
40
46
|
};
|
|
41
47
|
export const ISOMETRIC_PALETTE = Object.entries(ISOMETRIC_PREFABS).map(([key, prefab]) => {
|
package/dist/scene-default.js
CHANGED
|
@@ -54,6 +54,16 @@ export const ISOMETRIC_SCENE = {
|
|
|
54
54
|
// isometric e2e leg exercises (CA-13) — a Door placed inside any of
|
|
55
55
|
// those previously fired mid-test.
|
|
56
56
|
{ name: 'Door', prefab: 'objects/door', position: [2, 2] },
|
|
57
|
+
// Ambient wind over the whole meadow: thin translucent streaks drifting
|
|
58
|
+
// screen-right (logical [+x, -y]) in world space, on layer 0 so each
|
|
59
|
+
// streak y-sorts among the sprites (it can pass behind a tree). Placed
|
|
60
|
+
// two cells off the Player's spawn so the two editor markers never
|
|
61
|
+
// overlap; its spread still covers the whole map from here.
|
|
62
|
+
{ name: 'Wind', prefab: 'objects/wind', position: [8, 6] },
|
|
63
|
+
// One hurt-smoke source for every Health in the scene: DamagePuff moves
|
|
64
|
+
// it to whoever takes damage and puffs there. Parked in the empty
|
|
65
|
+
// south corner until the first hit, clear of the Ground's origin marker.
|
|
66
|
+
{ name: 'HurtSmoke', prefab: 'objects/hurt-smoke', position: [14, 14] },
|
|
57
67
|
],
|
|
58
68
|
ui: ['crate-counter', 'health'],
|
|
59
69
|
};
|
|
@@ -104,6 +114,12 @@ export const ISOMETRIC_CAVE_SCENE = {
|
|
|
104
114
|
position: [8, 2],
|
|
105
115
|
overrides: { SceneTransition: { scene: 'main' } },
|
|
106
116
|
},
|
|
117
|
+
// An enclosed room has no wind: a few faint motes drift instead.
|
|
118
|
+
{
|
|
119
|
+
name: 'Dust',
|
|
120
|
+
prefab: 'objects/cave-dust',
|
|
121
|
+
position: [ISOMETRIC_CAVE_MAP_WIDTH / 2, ISOMETRIC_CAVE_MAP_HEIGHT / 2],
|
|
122
|
+
},
|
|
107
123
|
],
|
|
108
124
|
ui: ['health'],
|
|
109
125
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waica/archetype-isometric",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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.
|
|
28
|
-
"@waica/engine": "^0.
|
|
27
|
+
"@waica/behaviors": "^0.21.0",
|
|
28
|
+
"@waica/engine": "^0.21.0"
|
|
29
29
|
}
|
|
30
30
|
}
|