@korial29/tiny-fps 0.157.0 → 0.158.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.
@@ -26,8 +26,9 @@ export interface Audio {
26
26
  say(id: number): void;
27
27
  /**
28
28
  * Says clip `id` of the players' voices (CAST): placed and fainter with distance as play() with
29
- * `at`, centred without; over the `radio`, thin as through a headset. False, and silent, until
30
- * the voices are decoded.
29
+ * `at`, centred without; over the `radio`, clipped and thin as through a cheap headset, a burst
30
+ * of squelch before and after it and a hiss under it. False, and silent, until the voices are
31
+ * decoded.
31
32
  */
32
33
  speak(id: number, at?: Vec3, gain?: number, rate?: number, radio?: boolean): boolean;
33
34
  /** The sound `id` (one of LOOPED) as a loop, silent until its first set; the own player's, centred. */
@@ -124,10 +124,10 @@ export interface Hud {
124
124
  feed(by: [string, number], who: [string, number]): void;
125
125
  /**
126
126
  * An ally on the radio: the small screen with `name` in `team`'s colour opens for `s` seconds
127
- * (and COMM_TAIL more), a newer one taking its place. Returns its canvas (COMM pixels square),
128
- * cleared, for his face.
127
+ * (and COMM_TAIL more), a newer one taking its place, and shows his `face` (COMM pixels square)
128
+ * as a scrambled transmission with bad reception (signal.ts), static alone without one.
129
129
  */
130
- comm(name: string, team: number, s: number): HTMLCanvasElement;
130
+ comm(name: string, team: number, s: number, face?: CanvasImageSource): void;
131
131
  /**
132
132
  * The rover: `act` is what E does now ('drive', 'ride', 'get out'; '' hides the prompt), and
133
133
  * `speed` the km/h shown at the wheel, where the gun and the crosshair then hide; undefined off it.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The signal of a line of `len` s, stepped each frame by `dt` s: its loss, 0 clear to 1 lost.
3
+ * It locks on from static, wavers about a fifth, drops out for a tenth of a second now and then,
4
+ * and goes over the `tail` s after the line.
5
+ */
6
+ export declare const createSignal: (len: number, tail: number) => (dt: number, rand?: () => number) => number;
7
+ /**
8
+ * Picture `src` (RGBA, `w` by `h`) into `dst` as received with loss `k` (0 to 1): bands of rows
9
+ * torn sideways, in blocks or lost to static, more and wider as `k` grows, the red a few pixels
10
+ * off, grain and a scanline every third row.
11
+ */
12
+ export declare const scramble: (src: Uint8ClampedArray, dst: Uint8ClampedArray, w: number, h: number, k: number, rand?: () => number) => void;
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.157.0",
5
+ "version": "0.158.0",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"