@korial29/tiny-fps 0.219.0 → 0.221.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.
@@ -17,6 +17,8 @@ export declare const HEAD_PX = 112;
17
17
  /** The haircuts of each body, in HAIRS_N's order: the man's by length (LENGTHS, soldier.ts), the woman's STYLE (hair.ts). */
18
18
  export declare const HAIR_NAMES: string[][];
19
19
  export declare const ROLES: [name: string, pros: string, cons: string, where: string][];
20
+ /** A skin tone (TONES, linear) as a CSS colour. */
21
+ export declare const swatch: (t: number[]) => string;
20
22
  /** Capture the flag in a few lines, with the room's default rules. */
21
23
  export declare const GOAL: string[];
22
24
  /**
@@ -51,9 +53,10 @@ export interface Hud {
51
53
  title(status: string, name: string, tag?: string, lore?: string): void;
52
54
  /**
53
55
  * Whether the player has been in the game: then the title screen opens on the pause menu (PAUSE)
54
- * rather than the whole panel, until he plays again.
56
+ * rather than the whole panel, until he plays again. `fresh`: he has not played yet (he comes from
57
+ * the character screen), its first button reads Play.
55
58
  */
56
- paused(on: boolean): void;
59
+ paused(on: boolean, fresh?: boolean): void;
57
60
  /**
58
61
  * The character on the title screen: `pick` is told the whole choice (the body, the skin, the
59
62
  * haircut, the class) each time the player changes a part of it. Returns the canvas of his live
@@ -13,9 +13,17 @@ export interface TinyFpsOptions {
13
13
  map?: string;
14
14
  /** The character to play (BODY): the man (0, the default) or the woman (1). The look only. */
15
15
  body?: number;
16
+ /**
17
+ * Opens on the character screen (lobby.ts): the room is joined and the map loads only once its
18
+ * Start is pressed, with the character picked there. Without it, the room is joined at once.
19
+ */
20
+ cast?: boolean;
16
21
  }
17
- /** quit: the player left from the pause menu (Escape, then Quit); the page decides where he goes. */
18
- export type TinyFpsEvent = 'roster' | 'open' | 'close' | 'quit';
22
+ /**
23
+ * quit: the player left from the pause menu (Escape, then Quit); the page decides where he goes.
24
+ * start: the character screen's Start (TinyFpsOptions.cast), the map loading from then on.
25
+ */
26
+ export type TinyFpsEvent = 'roster' | 'open' | 'close' | 'quit' | 'start';
19
27
  export interface TinyFps {
20
28
  on(ev: TinyFpsEvent, cb: () => void): void;
21
29
  /** Everyone in the room, the own player included. */
@@ -0,0 +1,21 @@
1
+ import type { Choice } from '../shared/types';
2
+ import type { WorldDef } from '../shared/world';
3
+ /** A whole choice: the body, the skin, the haircut and the class. */
4
+ export type Cast = Choice & {
5
+ body: number;
6
+ };
7
+ /** Each class in ROLE's order: its name, a few words for its tile, and plain lists of what it is good and bad at. */
8
+ export declare const TRAITS: {
9
+ name: string;
10
+ tag: string;
11
+ pros: string[];
12
+ cons: string[];
13
+ }[];
14
+ export interface Lobby {
15
+ destroy(): void;
16
+ }
17
+ /**
18
+ * Shows the character screen in `container` for the map `def` (the classes it offers, its sky);
19
+ * `start` hears the whole choice on Start, after the screen is gone.
20
+ */
21
+ export declare const createLobby: (container: HTMLElement, def: WorldDef, start: (c: Cast) => void) => Lobby;
@@ -220,6 +220,10 @@ export declare const HEAD: {
220
220
  /** A picture's framing, and whether he grins in it. */
221
221
  export type Shot = typeof PORTRAIT & {
222
222
  grin?: boolean;
223
+ /** What he holds, over the empty hands of a picture (the character screen's weapon). */
224
+ hold?: Partial<PlayerState>;
225
+ /** Radians he is turned from his usual pose, towards his left: a weapon held ahead then shows across the picture. */
226
+ spin?: number;
223
227
  };
224
228
  /** An ally's face on the radio screen: the head nearly from the front, grinning. */
225
229
  export declare const FACE: Shot;
@@ -100,18 +100,28 @@ export interface Skin {
100
100
  }
101
101
  /** How far out the face is (its z) at x across, height y: the carved surface, found by halving. */
102
102
  export declare const onHead: (x: number, y: number) => number;
103
+ /** The exponent of the dome's sections, 2 an ellipse: over it, a flatter top and fuller corners (the user, 2026-11-24: flatten the top a little, no egg). */
104
+ export declare const CREST_E = 2.5;
103
105
  /**
104
106
  * How much larger its head is than it was drawn (the user, 2026-11-16: a bigger head), about the
105
107
  * head joint: the dome here (CREST), the face's pieces in xeno.ts (grow()).
106
108
  */
107
109
  export declare const HEAD_K = 1.12;
108
110
  /** And how much narrower (the user, 2026-11-16: less round, the sides in), across it alone. */
109
- export declare const HEAD_X = 0.86;
111
+ export declare const HEAD_X = 0.78;
112
+ /** The dome's length behind the face's edge, metres, before the head is grown. */
113
+ export declare const CREST_LEN: number;
110
114
  /**
111
115
  * The dome's section `z` behind the face's edge (0 to PROFILE[0]), in the rest pose: its centre's
112
- * height, half width and half height (an ellipse). xeno.ts lays its veins on it.
116
+ * height, half width and half height (a superellipse of exponent CREST_E). xeno.ts lays its hoses on it.
113
117
  */
114
118
  export declare const domeAt: (z: number) => [number, number, number];
119
+ /**
120
+ * How the dome's section changes a metre behind the face's edge, over its first strip, before the
121
+ * head is grown: its centre's height, half width and half height. The face's rim takes its normal
122
+ * from it (skull() in xeno.ts).
123
+ */
124
+ export declare const RIM: number[];
115
125
  /** How far out the woman's bust stands at its fullest, on the man's rest mesh, metres. */
116
126
  export declare const BUST = 0.028;
117
127
  /** Where it is fullest, metres up (the user, 2026-11-11: a little higher; it was 1.345). */
@@ -15,7 +15,7 @@ export interface Draw {
15
15
  f?: Flesh;
16
16
  /** Worn: armour, which the shader scuffs (grime, chipped paint, scratches) on its glossy and gold parts. */
17
17
  w?: boolean;
18
- /** Thin: too fine for a shadow, left out of the depth passes (the xenomorph's veins, teeth and eyes). */
18
+ /** Thin: too fine for a shadow, left out of the depth passes (the xenomorph's teeth and hoses). */
19
19
  s?: boolean;
20
20
  /** Close hair (hair.ts), coloured `rgb`, swung by `sw` in the head's frame at the time `t`: the shader sways it (swayOf()). */
21
21
  h?: {
@@ -168,6 +168,12 @@ export declare const heel: (out: Out, at: Vec3, q: Quat, lod: number) => void;
168
168
  * its rim fading into the skin toward the armpit.
169
169
  */
170
170
  export declare const cuff: (out: Out, at: Vec3, q: Quat, lod: number, s: number) => void;
171
+ /**
172
+ * Its carapace (the user, 2026-11-24: no eyes; the whole top of the head from their line up smooth,
173
+ * black and glossy): its colour, the height on the face it ends at, and how far its edge stands
174
+ * out of the face under it, metres.
175
+ */
176
+ export declare const SHELL: number[];
171
177
  /** Its head's chitin: the dome's (the skin's TRIM, soldier.ts) and its face's, the body's own. */
172
178
  export declare const HEAD: number[];
173
179
  /**
@@ -182,30 +188,29 @@ export declare const HEAD: number[];
182
188
  */
183
189
  export declare const HEAD_UP = 0.065;
184
190
  /**
185
- * The face of its skull, a human skull's in its chitin: a forehead a smooth sphere, the
186
- * orbits sunk, the cheekbones, no nose; the mouth an opening whose edge the lips hide, dark inside,
187
- * with grey teeth, the fangs longest. A grid over the face, finer the closer.
191
+ * Its face, eyeless: over EDGE the front of its glossy carapace, one smooth ellipsoid with the
192
+ * dome; under it its chitin, the cheekbones, no nose, the mouth wide open, an opening whose edge
193
+ * the lips hide, dark inside, with steel teeth, the fangs longest. A grid over the face, finer the
194
+ * closer.
188
195
  */
189
196
  export declare const skull: (out: Out, head: Vec3, q: Quat, lod: number) => void;
197
+ /**
198
+ * Its lower jaw (HINGE, ARC), on the head joint: a bone taller than wide round the U, deepest at
199
+ * the chin, its ends buried in the throat behind the cheeks.
200
+ */
201
+ export declare const jaw: (out: Out, head: Vec3, q: Quat, lod: number) => void;
202
+ export declare const belly: (out: Out, head: Vec3, q: Quat, lod: number) => void;
190
203
  /**
191
204
  * The fine parts of its face, too thin for a shadow (soldier.ts keeps them out of the depth passes):
192
205
  * its steel teeth and the cords of sinew beside its mouth. Not far.
193
206
  */
194
207
  export declare const teeth: (out: Out, head: Vec3, q: Quat, lod: number) => void;
195
- /**
196
- * Veins along its dome (the user, 2026-11-16), on the head joint: on each side three running back
197
- * from the face's edge along the banana, wandering a little up and down its side, thinning toward
198
- * the back, with a short branch off each; one along each side of the top. Half sunk in the skin.
199
- */
200
- export declare const veins: (out: Out, head: Vec3, q: Quat, lod: number) => void;
201
208
  /**
202
209
  * Striated tubes blended into the sides of its dome (the user, 2026-11-16), on the head joint: two
203
210
  * each side running back from behind the face along the banana's lower flank, half sunk in it and
204
211
  * sinking wholly at both ends.
205
212
  */
206
213
  export declare const hoses: (out: Out, head: Vec3, q: Quat, lod: number) => void;
207
- /** Its eyes, glowing slits at the back of the orbits in the team's `color`. */
208
- export declare const eyes: (out: Out, head: Vec3, q: Quat, color: number[], lod?: number) => void;
209
214
  /** A rigid piece made at the origin of its joint's frame, then only placed (store.ts). */
210
215
  type Make = (o: Out, at: Vec3, q: Quat) => void;
211
216
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@korial29/tiny-fps",
3
3
  "description": "Tiny multiplayer first-person rooftop game for the browser: raw WebGL, zero runtime dependencies, WebSocket or same-browser multi-tab play.",
4
4
  "license": "Apache-2.0",
5
- "version": "0.219.0",
5
+ "version": "0.221.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"