@almadar/ui 5.71.0 → 5.73.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/avl/index.cjs +2178 -2309
- package/dist/avl/index.js +912 -1043
- package/dist/components/game/atoms/ActionButton.d.ts +3 -3
- package/dist/components/game/atoms/ChoiceButton.d.ts +3 -3
- package/dist/components/game/atoms/ComboCounter.d.ts +3 -3
- package/dist/components/game/atoms/ControlButton.d.ts +3 -3
- package/dist/components/game/atoms/DamageNumber.d.ts +3 -3
- package/dist/components/game/atoms/DialogueBubble.d.ts +3 -3
- package/dist/components/game/atoms/ItemSlot.d.ts +3 -3
- package/dist/components/game/atoms/ResourceCounter.d.ts +3 -3
- package/dist/components/game/atoms/ScoreDisplay.d.ts +4 -6
- package/dist/components/game/atoms/Sprite.d.ts +9 -21
- package/dist/components/game/atoms/StateIndicator.d.ts +2 -2
- package/dist/components/game/atoms/StatusEffect.d.ts +3 -3
- package/dist/components/game/atoms/TurnIndicator.d.ts +3 -3
- package/dist/components/game/atoms/WaypointMarker.d.ts +3 -3
- package/dist/components/game/atoms/XPBar.d.ts +1 -1
- package/dist/components/game/molecules/CardHand.d.ts +2 -2
- package/dist/components/game/molecules/DialogueBox.d.ts +3 -3
- package/dist/components/game/molecules/EnemyPlate.d.ts +3 -3
- package/dist/components/game/molecules/GameCanvas2D.d.ts +3 -3
- package/dist/components/game/molecules/GameCanvas3D.d.ts +0 -2
- package/dist/components/game/molecules/HealthPanel.d.ts +3 -3
- package/dist/components/game/molecules/IsometricCanvas.d.ts +11 -13
- package/dist/components/game/molecules/PlatformerCanvas.d.ts +4 -1
- package/dist/components/game/molecules/PowerupSlots.d.ts +3 -3
- package/dist/components/game/molecules/StatBadge.d.ts +6 -4
- package/dist/components/game/molecules/TurnPanel.d.ts +3 -3
- package/dist/components/game/molecules/three/index.cjs +55 -109
- package/dist/components/game/molecules/three/index.js +55 -109
- package/dist/components/game/molecules/useUnitSpriteAtlas.d.ts +6 -12
- package/dist/components/game/organisms/BattleBoard.d.ts +5 -6
- package/dist/components/game/organisms/CardBattlerBoard.d.ts +3 -4
- package/dist/components/game/organisms/CastleBoard.d.ts +5 -6
- package/dist/components/game/organisms/CityBuilderBoard.d.ts +6 -7
- package/dist/components/game/organisms/FishingBoard.d.ts +4 -6
- package/dist/components/game/organisms/PlatformerBoard.d.ts +5 -5
- package/dist/components/game/organisms/RoguelikeBoard.d.ts +4 -5
- package/dist/components/game/organisms/TopDownShooterBoard.d.ts +5 -6
- package/dist/components/game/organisms/TowerDefenseBoard.d.ts +5 -6
- package/dist/components/game/organisms/VisualNovelBoard.d.ts +4 -5
- package/dist/components/game/organisms/WorldMapBoard.d.ts +5 -6
- package/dist/components/game/organisms/types/effects.d.ts +7 -8
- package/dist/components/game/organisms/types/isometric.d.ts +24 -8
- package/dist/components/game/organisms/types/spriteAnimation.d.ts +3 -4
- package/dist/components/game/organisms/utils/makeAsset.d.ts +5 -0
- package/dist/components/game/templates/PlatformerTemplate.d.ts +5 -4
- package/dist/components/game/templates/game3dAssetManifest.d.ts +6 -8
- package/dist/components/index.cjs +2314 -2411
- package/dist/components/index.js +1203 -1300
- package/dist/providers/index.cjs +1987 -2118
- package/dist/providers/index.js +888 -1019
- package/dist/runtime/index.cjs +2043 -2174
- package/dist/runtime/index.js +892 -1023
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
-
import type { AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
21
|
+
import type { Asset, AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
22
22
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
23
23
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
24
24
|
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
@@ -48,11 +48,10 @@ export type BattleSlotContext = {
|
|
|
48
48
|
};
|
|
49
49
|
/** Asset manifest shape for BattleBoard. */
|
|
50
50
|
type BattleAssetManifest = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
effects?: Record<string, AssetUrl>;
|
|
51
|
+
terrains?: Record<string, Asset>;
|
|
52
|
+
units?: Record<string, Asset>;
|
|
53
|
+
features?: Record<string, Asset>;
|
|
54
|
+
effects?: Record<string, Asset>;
|
|
56
55
|
};
|
|
57
56
|
export interface BattleBoardProps extends DisplayStateProps {
|
|
58
57
|
/** Entity (single board state) containing all board data */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
3
3
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
4
|
-
/** Manifest of
|
|
4
|
+
/** Manifest of per-card sprite map (UI value DTO). */
|
|
5
5
|
type CardBattlerAssetManifest = {
|
|
6
|
-
|
|
7
|
-
cards?: Record<string, AssetUrl>;
|
|
6
|
+
cards?: Record<string, Asset>;
|
|
8
7
|
};
|
|
9
8
|
/** One card as carried on the entity / passed as a prop. */
|
|
10
9
|
export interface CardBattlerCard {
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
15
|
import React from 'react';
|
|
16
|
-
import type {
|
|
16
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
17
17
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
18
|
-
/** Manifest of
|
|
18
|
+
/** Manifest of per-kind sprite maps (UI value DTO). */
|
|
19
19
|
type CastleAssetManifest = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
features?: Record<string, AssetUrl>;
|
|
20
|
+
terrains?: Record<string, Asset>;
|
|
21
|
+
units?: Record<string, Asset>;
|
|
22
|
+
features?: Record<string, Asset>;
|
|
24
23
|
};
|
|
25
24
|
/** Context exposed to render-prop slots */
|
|
26
25
|
export type CastleSlotContext = {
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
3
3
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
4
|
-
/** Manifest of
|
|
4
|
+
/** Manifest of per-kind sprite maps (UI value DTO). */
|
|
5
5
|
type CityBuilderAssetManifest = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
features?: Record<string, AssetUrl>;
|
|
6
|
+
terrains?: Record<string, Asset>;
|
|
7
|
+
units?: Record<string, Asset>;
|
|
8
|
+
features?: Record<string, Asset>;
|
|
10
9
|
};
|
|
11
10
|
export interface CityBuilderTile {
|
|
12
11
|
x: number;
|
|
13
12
|
y: number;
|
|
14
13
|
terrain?: string;
|
|
15
|
-
terrainSprite?:
|
|
14
|
+
terrainSprite?: Asset;
|
|
16
15
|
passable?: boolean;
|
|
17
16
|
}
|
|
18
17
|
export interface CityBuilderBuilding {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Asset, EventEmit } from '@almadar/core';
|
|
3
3
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
4
4
|
export interface FishingBoardProps extends DisplayStateProps {
|
|
5
|
-
/** Background image
|
|
6
|
-
backgroundImage?:
|
|
7
|
-
/** Base URL prepended to asset paths */
|
|
8
|
-
assetBaseUrl?: AssetUrl;
|
|
5
|
+
/** Background image asset for the fishing scene */
|
|
6
|
+
backgroundImage?: Asset;
|
|
9
7
|
/** Render scale */
|
|
10
8
|
scale?: number;
|
|
11
9
|
/** Show minimap overlay */
|
|
@@ -26,7 +24,7 @@ export interface FishingBoardProps extends DisplayStateProps {
|
|
|
26
24
|
unitId: string;
|
|
27
25
|
}>;
|
|
28
26
|
}
|
|
29
|
-
export declare function FishingBoard({ backgroundImage,
|
|
27
|
+
export declare function FishingBoard({ backgroundImage, scale, showMinimap, enableCamera, width, height, isLoading, error, className, }: FishingBoardProps): React.ReactElement;
|
|
30
28
|
export declare namespace FishingBoard {
|
|
31
29
|
var displayName: string;
|
|
32
30
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
3
3
|
import type { PlatformerPlatform, PlatformerPlayer } from '../molecules/PlatformerCanvas';
|
|
4
4
|
export interface PlatformerBoardProps {
|
|
5
5
|
/** Entity containing all board state (result, lives, score, level, player, platforms) */
|
|
@@ -21,10 +21,10 @@ export interface PlatformerBoardProps {
|
|
|
21
21
|
worldHeight?: number;
|
|
22
22
|
canvasWidth?: number;
|
|
23
23
|
canvasHeight?: number;
|
|
24
|
-
/** Player sprite
|
|
25
|
-
playerSprite?:
|
|
26
|
-
/** Map of platform type to tile sprite
|
|
27
|
-
tileSprites?: Record<string,
|
|
24
|
+
/** Player sprite */
|
|
25
|
+
playerSprite?: Asset;
|
|
26
|
+
/** Map of platform type to tile sprite */
|
|
27
|
+
tileSprites?: Record<string, Asset>;
|
|
28
28
|
/** Canvas background color */
|
|
29
29
|
bgColor?: string;
|
|
30
30
|
/** Event names forwarded to PlatformerCanvas */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
3
3
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
4
4
|
import type { IsometricTile } from './types/isometric';
|
|
5
5
|
type PlayerPos = {
|
|
@@ -20,10 +20,9 @@ type ItemRow = {
|
|
|
20
20
|
kind: 'health_potion' | 'sword' | 'shield';
|
|
21
21
|
};
|
|
22
22
|
type RoguelikeAssetManifest = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
features?: Record<string, AssetUrl>;
|
|
23
|
+
terrains?: Record<string, Asset>;
|
|
24
|
+
units?: Record<string, Asset>;
|
|
25
|
+
features?: Record<string, Asset>;
|
|
27
26
|
};
|
|
28
27
|
export interface RoguelikeBoardProps extends DisplayStateProps {
|
|
29
28
|
entity?: EntityRow | readonly EntityRow[];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
/**
|
|
2
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
3
|
+
/** Per-kind sprite maps (organism owns asset choice; UI value DTO). */
|
|
4
4
|
type ShooterAssetManifest = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
background?: AssetUrl;
|
|
5
|
+
units?: Record<string, Asset>;
|
|
6
|
+
features?: Record<string, Asset>;
|
|
7
|
+
background?: Asset;
|
|
9
8
|
};
|
|
10
9
|
export interface ShooterPlayer {
|
|
11
10
|
x: number;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
2
|
+
import type { Asset, AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
3
3
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
4
|
-
/** Manifest of
|
|
4
|
+
/** Manifest of per-kind sprite maps (UI value DTO). */
|
|
5
5
|
type TowerDefenseAssetManifest = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
features?: Record<string, AssetUrl>;
|
|
6
|
+
terrains?: Record<string, Asset>;
|
|
7
|
+
units?: Record<string, Asset>;
|
|
8
|
+
features?: Record<string, Asset>;
|
|
10
9
|
};
|
|
11
10
|
export interface TowerDefenseTile {
|
|
12
11
|
x: number;
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
* the `assetManifest` prop (organism owns asset choice — no hardcoded URLs).
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import type {
|
|
10
|
+
import type { Asset, EventEmit, EntityRow } from '@almadar/core';
|
|
11
11
|
import type { DisplayStateProps } from '../../core/organisms/types';
|
|
12
|
-
/** Manifest of
|
|
12
|
+
/** Manifest of per-key scene + portrait maps (UI value DTO). */
|
|
13
13
|
type VisualNovelAssetManifest = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
portraits?: Record<string, AssetUrl>;
|
|
14
|
+
backgrounds?: Record<string, Asset>;
|
|
15
|
+
portraits?: Record<string, Asset>;
|
|
17
16
|
};
|
|
18
17
|
export interface VisualNovelChoice {
|
|
19
18
|
label: string;
|
|
@@ -19,16 +19,15 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
-
import type { AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
22
|
+
import type { Asset, AssetUrl, EventEmit, EntityRow } from '@almadar/core';
|
|
23
23
|
import type { IsometricTile, IsometricUnit, IsometricFeature } from './types/isometric';
|
|
24
24
|
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
25
25
|
import type { UiError } from '../../core/atoms/types';
|
|
26
|
-
/** Manifest of
|
|
26
|
+
/** Manifest of per-kind sprite maps (UI value DTO). */
|
|
27
27
|
type WorldMapAssetManifest = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
features?: Record<string, AssetUrl>;
|
|
28
|
+
terrains?: Record<string, Asset>;
|
|
29
|
+
units?: Record<string, Asset>;
|
|
30
|
+
features?: Record<string, Asset>;
|
|
32
31
|
};
|
|
33
32
|
/** Context exposed to render-prop slots. Hex / hero rows are `EntityRow`. */
|
|
34
33
|
export type WorldMapSlotContext = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AssetUrl } from '@almadar/core';
|
|
2
1
|
/**
|
|
3
2
|
* Canvas Effect Types
|
|
4
3
|
*
|
|
@@ -12,7 +11,7 @@ import type { AssetUrl } from '@almadar/core';
|
|
|
12
11
|
*/
|
|
13
12
|
export interface CanvasParticle {
|
|
14
13
|
/** Sprite URL (white-on-transparent particle) */
|
|
15
|
-
spriteUrl:
|
|
14
|
+
spriteUrl: string;
|
|
16
15
|
/** Current position in screen pixels */
|
|
17
16
|
x: number;
|
|
18
17
|
y: number;
|
|
@@ -51,7 +50,7 @@ export interface CanvasParticle {
|
|
|
51
50
|
*/
|
|
52
51
|
export interface ParticleEmitterConfig {
|
|
53
52
|
/** Array of sprite URLs to randomly pick from */
|
|
54
|
-
spriteUrls:
|
|
53
|
+
spriteUrls: string[];
|
|
55
54
|
/** Number of particles to spawn */
|
|
56
55
|
count: number;
|
|
57
56
|
/** Spawn origin in screen pixels */
|
|
@@ -96,7 +95,7 @@ export interface ParticleEmitterConfig {
|
|
|
96
95
|
*/
|
|
97
96
|
export interface CanvasSequence {
|
|
98
97
|
/** Ordered array of frame sprite URLs */
|
|
99
|
-
frameUrls:
|
|
98
|
+
frameUrls: string[];
|
|
100
99
|
/** Position in screen pixels (top-left of sprite) */
|
|
101
100
|
x: number;
|
|
102
101
|
y: number;
|
|
@@ -123,7 +122,7 @@ export interface CanvasSequence {
|
|
|
123
122
|
* Configuration for spawning a frame sequence.
|
|
124
123
|
*/
|
|
125
124
|
export interface SequenceConfig {
|
|
126
|
-
frameUrls:
|
|
125
|
+
frameUrls: string[];
|
|
127
126
|
originX: number;
|
|
128
127
|
originY: number;
|
|
129
128
|
frameDuration: number;
|
|
@@ -142,7 +141,7 @@ export interface SequenceConfig {
|
|
|
142
141
|
*/
|
|
143
142
|
export interface CanvasOverlay {
|
|
144
143
|
/** Sprite URL */
|
|
145
|
-
spriteUrl:
|
|
144
|
+
spriteUrl: string;
|
|
146
145
|
/** Center position in screen pixels */
|
|
147
146
|
x: number;
|
|
148
147
|
y: number;
|
|
@@ -167,7 +166,7 @@ export interface CanvasOverlay {
|
|
|
167
166
|
* Configuration for spawning an overlay.
|
|
168
167
|
*/
|
|
169
168
|
export interface OverlayConfig {
|
|
170
|
-
spriteUrl:
|
|
169
|
+
spriteUrl: string;
|
|
171
170
|
originX: number;
|
|
172
171
|
originY: number;
|
|
173
172
|
alpha?: number;
|
|
@@ -217,7 +216,7 @@ export interface CombatPreset {
|
|
|
217
216
|
*/
|
|
218
217
|
export interface EffectAssetManifest {
|
|
219
218
|
/** Base URL for all asset paths */
|
|
220
|
-
baseUrl:
|
|
219
|
+
baseUrl: string;
|
|
221
220
|
/** Particle sprite groups (white-on-transparent, tinted at runtime) */
|
|
222
221
|
particles?: {
|
|
223
222
|
slash?: string[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Asset } from '@almadar/core';
|
|
2
|
+
import type { AnimationName } from './spriteAnimation';
|
|
2
3
|
/**
|
|
3
4
|
* Isometric Game Types
|
|
4
5
|
*
|
|
@@ -7,6 +8,17 @@ import type { AssetUrl } from '@almadar/core';
|
|
|
7
8
|
*
|
|
8
9
|
* @packageDocumentation
|
|
9
10
|
*/
|
|
11
|
+
/** An active visual effect on the board. x,y are grid tile coords; ttl = remaining ticks. */
|
|
12
|
+
export interface ActiveEffect {
|
|
13
|
+
/** Unique key — matched against assetManifest.effects for sprite lookup */
|
|
14
|
+
key: string;
|
|
15
|
+
/** Grid x coordinate */
|
|
16
|
+
x: number;
|
|
17
|
+
/** Grid y coordinate */
|
|
18
|
+
y: number;
|
|
19
|
+
/** Remaining ticks — used as a fade/scale hint (alpha = min(1, ttl/4)) */
|
|
20
|
+
ttl: number;
|
|
21
|
+
}
|
|
10
22
|
/** A single isometric tile on the grid */
|
|
11
23
|
export interface IsometricTile {
|
|
12
24
|
/** Optional unique identifier (required for 3D rendering) */
|
|
@@ -22,7 +34,7 @@ export interface IsometricTile {
|
|
|
22
34
|
/** Tile type for visual rendering (3D) */
|
|
23
35
|
type?: string;
|
|
24
36
|
/** Direct sprite URL override (bypasses getTerrainSprite resolver) */
|
|
25
|
-
terrainSprite?:
|
|
37
|
+
terrainSprite?: Asset;
|
|
26
38
|
/** Whether units can traverse this tile (default true) */
|
|
27
39
|
passable?: boolean;
|
|
28
40
|
/** Movement cost for pathfinding (default 1) */
|
|
@@ -32,7 +44,7 @@ export interface IsometricTile {
|
|
|
32
44
|
/** Elevation offset for 3D rendering */
|
|
33
45
|
elevation?: number;
|
|
34
46
|
/** 3D model URL (GLB format) for GameCanvas3D — rendered via ModelLoader with box fallback */
|
|
35
|
-
modelUrl?:
|
|
47
|
+
modelUrl?: Asset;
|
|
36
48
|
}
|
|
37
49
|
/** A unit positioned on the isometric grid */
|
|
38
50
|
export type IsometricUnit = {
|
|
@@ -50,13 +62,13 @@ export type IsometricUnit = {
|
|
|
50
62
|
/** Grid z coordinate (3D format) */
|
|
51
63
|
z?: number;
|
|
52
64
|
/** Static sprite URL (used when no sprite sheet animation) */
|
|
53
|
-
sprite?:
|
|
65
|
+
sprite?: Asset;
|
|
54
66
|
/** Sprite-sheet atlas JSON URL (e.g. `.../guardian-sprite-sheet.json`).
|
|
55
67
|
* When set, the canvas loads the atlas and crops/animates a single frame
|
|
56
68
|
* by animation state instead of drawing the whole sheet. */
|
|
57
|
-
spriteSheet?:
|
|
69
|
+
spriteSheet?: Asset;
|
|
58
70
|
/** 3D model URL (GLB format) for GameCanvas3D — rendered via ModelLoader with box fallback */
|
|
59
|
-
modelUrl?:
|
|
71
|
+
modelUrl?: Asset;
|
|
60
72
|
/** Unit archetype key for sprite resolution */
|
|
61
73
|
unitType?: string;
|
|
62
74
|
/** Hero identifier for sprite sheet lookup */
|
|
@@ -85,6 +97,10 @@ export type IsometricUnit = {
|
|
|
85
97
|
};
|
|
86
98
|
/** Elevation offset for 3D rendering */
|
|
87
99
|
elevation?: number;
|
|
100
|
+
/** Animation name — driven by the LOLO state machine; renderer defaults to 'idle' */
|
|
101
|
+
animation?: AnimationName;
|
|
102
|
+
/** Frame index within the animation — driven by the LOLO state machine; renderer defaults to 0 */
|
|
103
|
+
frame?: number;
|
|
88
104
|
};
|
|
89
105
|
/** A map feature (resource, building, portal, etc.) */
|
|
90
106
|
export type IsometricFeature = {
|
|
@@ -99,9 +115,9 @@ export type IsometricFeature = {
|
|
|
99
115
|
/** Feature type key (e.g., 'goldMine', 'castle', 'portal') */
|
|
100
116
|
type: string;
|
|
101
117
|
/** Direct sprite URL override (bypasses getFeatureSprite resolver) */
|
|
102
|
-
sprite?:
|
|
118
|
+
sprite?: Asset;
|
|
103
119
|
/** 3D model URL (GLB format) for GameCanvas3D */
|
|
104
|
-
assetUrl?:
|
|
120
|
+
assetUrl?: Asset;
|
|
105
121
|
/** Color override for 3D rendering */
|
|
106
122
|
color?: string;
|
|
107
123
|
/** Elevation offset for 3D rendering */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AssetUrl } from '@almadar/core';
|
|
2
1
|
/**
|
|
3
2
|
* Sprite Sheet Animation Types
|
|
4
3
|
*
|
|
@@ -27,7 +26,7 @@ export interface AnimationDef {
|
|
|
27
26
|
/** A resolved frame ready to draw on canvas */
|
|
28
27
|
export interface ResolvedFrame {
|
|
29
28
|
/** URL of the sprite sheet image */
|
|
30
|
-
sheetUrl:
|
|
29
|
+
sheetUrl: string;
|
|
31
30
|
/** Source X in the sheet (pixel offset) */
|
|
32
31
|
sx: number;
|
|
33
32
|
/** Source Y in the sheet (pixel offset) */
|
|
@@ -68,9 +67,9 @@ export interface SpriteFrameDims {
|
|
|
68
67
|
/** Sheet URLs for both directions */
|
|
69
68
|
export interface SpriteSheetUrls {
|
|
70
69
|
/** Southeast-facing sheet URL */
|
|
71
|
-
se:
|
|
70
|
+
se: string;
|
|
72
71
|
/** Southwest-facing sheet URL */
|
|
73
|
-
sw:
|
|
72
|
+
sw: string;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
76
75
|
* Parsed sprite-sheet atlas JSON (e.g. `guardian-sprite-sheet.json`).
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Asset, EntityRole } from '@almadar/core';
|
|
2
|
+
/** Build an Asset from a url + the slot's role. Slot-fixed defaults by role. */
|
|
3
|
+
export declare function makeAsset(url: string, role: EntityRole, overrides?: Partial<Asset>): Asset;
|
|
4
|
+
/** Map a name→url record to name→Asset. */
|
|
5
|
+
export declare function makeAssetMap(record: Record<string, string>, role: EntityRole, overrides?: Partial<Asset>): Record<string, Asset>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { Asset } from '@almadar/core';
|
|
2
3
|
import type { TemplateProps } from '../../core/templates/types';
|
|
3
4
|
import type { PlatformerBoardProps } from '../organisms/PlatformerBoard';
|
|
4
5
|
export interface PlatformerTemplateProps extends TemplateProps {
|
|
@@ -10,10 +11,10 @@ export interface PlatformerTemplateProps extends TemplateProps {
|
|
|
10
11
|
/** Canvas display size */
|
|
11
12
|
canvasWidth?: number;
|
|
12
13
|
canvasHeight?: number;
|
|
13
|
-
/** Player sprite
|
|
14
|
-
playerSprite?:
|
|
15
|
-
/** Map of platform type to tile sprite
|
|
16
|
-
tileSprites?: Record<string,
|
|
14
|
+
/** Player sprite asset */
|
|
15
|
+
playerSprite?: Asset;
|
|
16
|
+
/** Map of platform type to tile sprite asset */
|
|
17
|
+
tileSprites?: Record<string, Asset>;
|
|
17
18
|
/** Canvas background color */
|
|
18
19
|
bgColor?: string;
|
|
19
20
|
/** Forwarded to PlatformerBoard to emit GAME_END into the FSM */
|
|
@@ -9,16 +9,14 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @packageDocumentation
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { Asset, EntityRow } from '@almadar/core';
|
|
13
13
|
import type { IsometricTile, IsometricFeature } from '../organisms/types/isometric';
|
|
14
|
-
/** GLB model
|
|
14
|
+
/** GLB model assets for a 3D board, keyed by terrain "kind" and (optionally) feature type. */
|
|
15
15
|
export interface Game3DAssetManifest {
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** Feature/structure model URLs by feature type ('gold_mine', 'portal', …). */
|
|
21
|
-
features?: Record<string, AssetUrl>;
|
|
16
|
+
/** Floor model assets by terrain kind ('wall' | 'dirt' | 'open'). */
|
|
17
|
+
models?: Record<string, Asset>;
|
|
18
|
+
/** Feature/structure model assets by feature type ('gold_mine', 'portal', …). */
|
|
19
|
+
features?: Record<string, Asset>;
|
|
22
20
|
}
|
|
23
21
|
/** Layout-only tile (no model URL): position + terrain kind. */
|
|
24
22
|
export interface Tile3DLayout {
|