@korial29/tiny-fps 0.221.0 → 0.221.1

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.
@@ -11,7 +11,7 @@ export declare const keyBit: (code: string) => number;
11
11
  export declare const DOUBLE_CLICK_MS = 300;
12
12
  /** The wheel swaps the weapon at most this often (ms): a trackpad's flick is a hundred events, one swap. */
13
13
  export declare const WHEEL_MS = 250;
14
- /** The weapon chosen: 1 through 5 on the keyboard. */
14
+ /** The weapon chosen. The values are the wire's and the HUD's, not the keys' order: SLOTS has that. */
15
15
  export declare const WEAPON: {
16
16
  readonly GUN: 0;
17
17
  readonly BLADE: 1;
@@ -20,12 +20,16 @@ export declare const WEAPON: {
20
20
  readonly FISTS: 4;
21
21
  };
22
22
  /**
23
- * The weapon in a slot (1 to 5 less one), and the slot of a weapon: WEAPON's order, but for the
24
- * Hunter, whose wrist blades are slot 1 and harpoon slot 2 (the user, 2026-11-23). The swap is its
25
- * own inverse.
23
+ * The weapon on each key, 1 to 5. The marine, the ninja and the astronaut: fists, katana, pistol,
24
+ * assault (laser) rifle, Tesla (rail) gun (the user, 2026-11-24). The Hunter: wrist blades,
25
+ * harpoon, shoulder cannon, disc, and no fifth slot (the user, 2026-11-23).
26
26
  */
27
+ export declare const SLOTS: readonly number[];
28
+ /** The weapon in a slot (the key's number less one). */
27
29
  export declare const slotted: (slot: number, hunter?: boolean) => number;
28
- /** The choice after a key: 1 the gun, 2 the katana, 3 the rail gun, 4 the laser rifle (the Hunter's slots by slotted()), any other key keeps it. */
30
+ /** The slot of a weapon: slotted()'s inverse. */
31
+ export declare const slotOf: (weapon: number, hunter?: boolean) => number;
32
+ /** The choice after a key: the weapon in its slot (SLOTS), the numpad's keys as the digits'; any other key keeps it. */
29
33
  export declare const picked: (weapon: number, code: string, hunter?: boolean) => number;
30
34
  /** Which of the gun, the katana, the rail gun, the laser rifle and the fists a player has (the Hunter no fists); all of them when there is no state yet. */
31
35
  export declare const owned: (p?: PlayerState, hunter?: boolean) => boolean[];
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.221.0",
5
+ "version": "0.221.1",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"