@korial29/tiny-fps 0.114.0 → 0.115.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.
@@ -37,6 +37,8 @@ export interface Runner {
37
37
  seat?: Seat;
38
38
  /** The muzzle of the long gun in his hands as last drawn, from his feet: where its shots are seen to leave (combat.ts). */
39
39
  tip?: Vec3;
40
+ /** The BUILD of the body (rig.ts, PlayerInfo.body): the man's when absent. */
41
+ build?: number;
40
42
  }
41
43
  /**
42
44
  * The seat of a player who rides: the rover whose `driver` or `rider` he is. Nothing for one on
@@ -45,14 +47,19 @@ export interface Runner {
45
47
  export declare const seatOf: (p: PlayerState, rovers?: Rover[]) => Seat | undefined;
46
48
  /** Seconds a hit's wince lasts, and the grin of a capture or of a foe put down. */
47
49
  export declare const HURT: number, GRIN: number;
50
+ /**
51
+ * A woman's traits on the face of her id: never the heavy brow ridge, the wide jaw or the long
52
+ * lower face of the draw, fuller lips, and the scalp's hair flat under her style (hair.ts).
53
+ */
54
+ export declare const femme: (w: Float32Array) => void;
48
55
  /** A runner as first seen: in the pose its state asks for, no ease. */
49
- export declare const createRunner: (p: PlayerState, seat?: Seat) => Runner;
56
+ export declare const createRunner: (p: PlayerState, seat?: Seat, build?: number) => Runner;
50
57
  /**
51
58
  * Moves each runner of `book` to its player in `others` after dt seconds: a new player gets a
52
59
  * runner already in pose, one that left loses it. With a `world` the feet stand on the brushes
53
60
  * under them. The `tracer` gets the sparks of a limb cut off.
54
61
  */
55
- export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit">, rovers?: Rover[]) => void;
62
+ export declare const animate: (book: Map<number, Runner>, others: PlayerState[], dt: number, world?: World, tracer?: Pick<Tracer, "shock" | "spit">, rovers?: Rover[], builds?: ReadonlyMap<number, number>) => void;
56
63
  /**
57
64
  * A long gun's butt plate in the hollow of the right shoulder: from the shoulder joint, in the
58
65
  * chest's frame (to its right, up, back). The gun goes from there along the look, so it is
@@ -1,8 +1,9 @@
1
1
  import type { Input, PlayerInfo, Snapshot } from './types';
2
- /** join: the first frame of a peer. map: the host picks the map of the next match (MAPS key). */
2
+ /** join: the first frame of a peer, `body` the character he picked (BODY, the man without it). map: the host picks the map of the next match (MAPS key). */
3
3
  export type ClientText = {
4
4
  t: 'join';
5
5
  name: string;
6
+ body?: number;
6
7
  } | {
7
8
  t: 'map';
8
9
  map: string;
@@ -16,7 +16,14 @@ export interface PlayerInfo {
16
16
  team: number;
17
17
  /** CSS colour: the team's (TEAM_COLOR). */
18
18
  color: string;
19
+ /** BODY: the character he plays. Absent for the man, as before there was a choice. */
20
+ body?: number;
19
21
  }
22
+ /** The characters a player can be (PlayerInfo.body, the join's `body`): the look only, the game is the same for both. */
23
+ export declare const BODY: {
24
+ readonly MALE: 0;
25
+ readonly FEMALE: 1;
26
+ };
20
27
  /** Bits of Input.keys. Keys are read by KeyboardEvent.code, so WASD is ZQSD on AZERTY. */
21
28
  export declare const KEY: {
22
29
  readonly FORWARD: 1;
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.114.0",
5
+ "version": "0.115.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"