@korial29/tiny-fps 0.116.0 → 0.118.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/README.md +1 -1
- package/dist/index.js +18 -18
- package/dist/local.js +1 -1
- package/dist/server.js +86 -10
- package/dist/types/client/armor.d.ts +11 -0
- package/dist/types/client/doors.d.ts +25 -0
- package/dist/types/client/helm.d.ts +68 -0
- package/dist/types/client/helmet.d.ts +2 -0
- package/dist/types/client/pack.d.ts +2 -2
- package/dist/types/client/render.d.ts +3 -1
- package/dist/types/client/sfx.d.ts +4 -0
- package/dist/types/client/skin.d.ts +1 -1
- package/dist/types/shared/doors.d.ts +25 -0
- package/dist/types/shared/moonbase.d.ts +5 -0
- package/dist/types/shared/types.d.ts +2 -0
- package/dist/types/shared/world.d.ts +16 -0
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ export declare const cross: (a: Vec3, b: Vec3) => Vec3;
|
|
|
46
46
|
export declare const unit: (v: Vec3) => Vec3;
|
|
47
47
|
/** A signed power: the superellipse's |t|^p keeping t's sign. */
|
|
48
48
|
export declare const pow: (t: number, p: number) => number;
|
|
49
|
+
/** A triangle over `p`, wound as its first normal faces, in `col` on `layer`; none if it has no area. */
|
|
50
|
+
export declare const face: (out: number[], col: number[], layer: number, p: Spot[]) => void;
|
|
49
51
|
/**
|
|
50
52
|
* Triangles between the rows of points `rows`, each a closed ring of n (the first and the last may
|
|
51
53
|
* be one point), in `col` on `layer`; wound as the normals face. Triangles of no area are left out.
|
|
@@ -43,8 +43,8 @@ export declare const PAD: {
|
|
|
43
43
|
h: number;
|
|
44
44
|
cut: number;
|
|
45
45
|
};
|
|
46
|
-
/** The woman's
|
|
47
|
-
export declare const
|
|
46
|
+
/** The woman's cup, scaled about its joint: flatter. Her shoulders have caps of the armour (armor.ts), no pads. */
|
|
47
|
+
export declare const CUP_F: Vec3;
|
|
48
48
|
/** Appends both shoulder pads at level of detail `lod` on the arm joints (`arms`: the left's and the right's place and turn), in `plate` (white when absent), `scale`d about the joints. */
|
|
49
49
|
export declare const shoulders: (out: number[], arms: [Vec3, Quat][], lod: number, plate?: number[], scale?: number) => void;
|
|
50
50
|
/** Appends the crotch cup at level of detail `lod` on the pelvis joint at `at` turned by `q`, in `plate` (white when absent). */
|
|
@@ -125,7 +125,9 @@ export interface Renderer {
|
|
|
125
125
|
/** The map's rovers (Predictor.rovers()): drawn lit, casting shadows, with the other players. */
|
|
126
126
|
rovers?: Rover[],
|
|
127
127
|
/** The own player when the camera is not in his head (seated in a rover): drawn whole, like the others. */
|
|
128
|
-
self?: PlayerState
|
|
128
|
+
self?: PlayerState,
|
|
129
|
+
/** Adds what else moves in the map (the doors): drawn lit, casting shadows, with the other players. */
|
|
130
|
+
more?: (v: number[]) => void): void;
|
|
129
131
|
/** A world point on screen as of the last frame, in [0, 1] from the top left. */
|
|
130
132
|
project(x: number, y: number, z: number): [number, number] | undefined;
|
|
131
133
|
/** The footsteps of the player `id`'s runner so far (Gait.steps), undefined before it is drawn. */
|
|
@@ -88,6 +88,10 @@ export declare const SOUND: {
|
|
|
88
88
|
/** Breathing in a space helmet (the user, 2026-11-10), in then out: air drawn through the regulator, and let out with its valve's hiss. */
|
|
89
89
|
readonly INHALE: 43;
|
|
90
90
|
readonly EXHALE: 44;
|
|
91
|
+
/** An automatic door (doors.ts) sliding open: its seals let go with a hiss and its servo whirs up. */
|
|
92
|
+
readonly DOOR: 45;
|
|
93
|
+
/** And sliding shut: the servo whirs down and the panels meet with a thump. */
|
|
94
|
+
readonly SHUT: 46;
|
|
91
95
|
};
|
|
92
96
|
/**
|
|
93
97
|
* The sounds of the game: one entry per sound, its voices layered, in SOUND order. A low-passed
|
|
@@ -72,7 +72,7 @@ export interface Skin {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
/** How far out the woman's bust stands at its fullest, on the man's rest mesh, metres. */
|
|
75
|
-
export declare const BUST = 0.
|
|
75
|
+
export declare const BUST = 0.028;
|
|
76
76
|
/**
|
|
77
77
|
* The skin at a level of detail: 0 far, 1 near (see DETAIL in mesh.ts), 2 near, headless and
|
|
78
78
|
* handless, for the eye, 3 close (CLOSE in render.ts), twice the rings and half more sides, the
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { World } from './world';
|
|
2
|
+
type Vec3 = [number, number, number];
|
|
3
|
+
export declare const DOOR: {
|
|
4
|
+
/**
|
|
5
|
+
* Metres from the doorway within which a player on foot opens it, and a driven rover. A dash
|
|
6
|
+
* from 7 m is there in 0.65 s (2.7 m of burst at 16 m/s, the rest at a sprint's 9), a rover at
|
|
7
|
+
* its 23.2 m/s from 14 m in 0.6 s: the door has been open 0.3 s and 0.25 s by then.
|
|
8
|
+
*/
|
|
9
|
+
R: number;
|
|
10
|
+
ROVER_R: number;
|
|
11
|
+
/** Ticks it takes to open (0.35 s) and to shut (0.5 s). */
|
|
12
|
+
OPEN: number;
|
|
13
|
+
SHUT: number;
|
|
14
|
+
/** Ticks it stays open after the last one has left: a second. */
|
|
15
|
+
HOLD: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One tick of the doors of `w`: each opens while one of `feet` (the players who are up) is within
|
|
19
|
+
* DOOR.R of it or one of `rovers` (the driven ones) within DOOR.ROVER_R, stays open DOOR.HOLD ticks
|
|
20
|
+
* after the last, then shuts.
|
|
21
|
+
*/
|
|
22
|
+
export declare const swing: (w: World, feet: Vec3[], rovers?: Vec3[]) => void;
|
|
23
|
+
/** Every door shut: a new match. */
|
|
24
|
+
export declare const shut: (w: World) => void;
|
|
25
|
+
export {};
|
|
@@ -34,6 +34,11 @@ export declare const TUBES: Bx[];
|
|
|
34
34
|
export declare const HALL: number[][];
|
|
35
35
|
/** The mouths in the hall's wall (x and z of the middle from the centre, half width, height, depth): the door toward the flag, the tubes. */
|
|
36
36
|
export declare const MOUTHS: number[][];
|
|
37
|
+
/**
|
|
38
|
+
* The automatic doors of red's half (doors.ts), each the box its panels fill when shut: in the
|
|
39
|
+
* middle of the dome's door, then in the wall of each module's airlock.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DOORS: Bx[];
|
|
37
42
|
/**
|
|
38
43
|
* What stands in the hall, about the dome's centre: ghosts, since client/moonbase.ts draws them
|
|
39
44
|
* with the hall (the sun's shadow map is 64 m wide, a brush across the hall would be drawn sunlit).
|
|
@@ -396,6 +396,8 @@ export interface Snapshot {
|
|
|
396
396
|
balls?: Ball[];
|
|
397
397
|
/** The map's rovers, in the order of WorldDef.rovers. Absent: none. */
|
|
398
398
|
rovers?: Rover[];
|
|
399
|
+
/** How far each of WorldDef.doors is open, 0 shut to 1, in sixteen steps on the wire. Absent: none. */
|
|
400
|
+
doors?: number[];
|
|
399
401
|
}
|
|
400
402
|
/** Room rules, set by the host. Defaults in constants.ts (RULES). */
|
|
401
403
|
export interface Rules {
|
|
@@ -30,6 +30,11 @@ export interface TeamDef {
|
|
|
30
30
|
/** The laser rifle rack, past the rail gun's: walking within RACK_R gives the rifle with RIFLE_MAX rounds. */
|
|
31
31
|
rifle?: Vec3;
|
|
32
32
|
}
|
|
33
|
+
/** A sliding door (doors.ts): the box its two panels fill when shut, in a doorway of the brushes. */
|
|
34
|
+
export interface Door {
|
|
35
|
+
min: Vec3;
|
|
36
|
+
max: Vec3;
|
|
37
|
+
}
|
|
33
38
|
export interface WorldDef {
|
|
34
39
|
/** Shown on the title screen. */
|
|
35
40
|
name?: string;
|
|
@@ -68,6 +73,8 @@ export interface WorldDef {
|
|
|
68
73
|
relief?: ReliefDef;
|
|
69
74
|
/** Where the rovers (rover.ts) are parked, each as a spawn: the middle of its wheels on the ground and the yaw of its nose. Absent: none. */
|
|
70
75
|
rovers?: Spawn[];
|
|
76
|
+
/** The automatic doors (doors.ts). Absent: none. */
|
|
77
|
+
doors?: Door[];
|
|
71
78
|
}
|
|
72
79
|
/** A world ready for physics and drawing: the definition and a grid of brushes on the floor plane. */
|
|
73
80
|
export interface World {
|
|
@@ -78,6 +85,15 @@ export interface World {
|
|
|
78
85
|
grid: Map<number, number[]>;
|
|
79
86
|
/** The lattice of WorldDef.relief. */
|
|
80
87
|
relief?: Relief;
|
|
88
|
+
/**
|
|
89
|
+
* The state of each of WorldDef.doors: how far it is open, 0 shut to 1, and the ticks it stays
|
|
90
|
+
* open with nobody near. The host's doors.ts moves it, the client copies it from the snapshot:
|
|
91
|
+
* ray() stops at a door less than half open, a body never does.
|
|
92
|
+
*/
|
|
93
|
+
doors?: {
|
|
94
|
+
open: number;
|
|
95
|
+
wait: number;
|
|
96
|
+
}[];
|
|
81
97
|
}
|
|
82
98
|
/** The key of the cell with integer coordinates (cx, cz). */
|
|
83
99
|
export declare const key: (cx: number, cz: number) => number;
|
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.
|
|
5
|
+
"version": "0.118.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|