@korial29/tiny-fps 0.162.5 → 0.163.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/dist/index.js +31 -31
- package/dist/types/client/body.d.ts +12 -2
- package/dist/types/client/face.d.ts +9 -2
- package/dist/types/client/features.d.ts +0 -2
- package/dist/types/client/gait.d.ts +3 -1
- package/dist/types/client/limbs.d.ts +2 -1
- package/dist/types/client/skin.d.ts +6 -0
- package/dist/types/client/soldier.d.ts +0 -5
- package/dist/types/client/xeno.d.ts +99 -0
- package/package.json +1 -1
|
@@ -30,6 +30,8 @@ export interface Body {
|
|
|
30
30
|
wear(build: number, tone?: number[], ninja?: boolean, xeno?: boolean): void;
|
|
31
31
|
}
|
|
32
32
|
export declare const inv: ([x, y, z, w]: Quat) => Quat;
|
|
33
|
+
/** The shortest rotation that turns the direction a into b. */
|
|
34
|
+
export declare const arc: (a: Vec3, b: Vec3) => Quat;
|
|
33
35
|
/**
|
|
34
36
|
* Turns the limb of root joint j (a shoulder, a hip) in `q` so that its end reaches `to`, the
|
|
35
37
|
* middle joint toward `pole`. `s` is q solved: the bones keep their twist and swing the shortest
|
|
@@ -85,10 +87,14 @@ far?: boolean) => void;
|
|
|
85
87
|
export declare const clasp: (s: Solved, at: Vec3, g: Vec3, poles: [Vec3, Vec3]) => [Vec3, Vec3, Vec3, Vec3];
|
|
86
88
|
/** The woman's hand to the man's, about the wrist (SCALE in skin.ts has her glove's). */
|
|
87
89
|
export declare const HAND_F = 0.92;
|
|
90
|
+
/** The xenomorph's hands against the man's, about the wrist. */
|
|
91
|
+
export declare const CLAW_HAND = 1.3;
|
|
88
92
|
/** Sides around a finger (6 until the user, 2026-11-09: more detail on the hands). */
|
|
89
93
|
export declare const FINGER_SIDES = 10;
|
|
90
94
|
/** A ring of a tube: its centre and its two half axes. */
|
|
91
95
|
type Ring = [c: Vec3, x: Vec3, y: Vec3];
|
|
96
|
+
/** The curl the xenomorph's fingers close to at most. */
|
|
97
|
+
export declare const RAKE = 0.35;
|
|
92
98
|
/** The ring of a finger from which on it is bare: the glove's fingers end 60 % along the middle phalanx. */
|
|
93
99
|
export declare const BARE = 8;
|
|
94
100
|
/**
|
|
@@ -127,7 +133,9 @@ cup?: number,
|
|
|
127
133
|
/** A near runner's hand: fewer sides, on the near sleeve's cuff, and none of the glove's small parts. */
|
|
128
134
|
lite?: boolean,
|
|
129
135
|
/** The marine's: lit buttons on the strap round the wrist (WRIST_LIGHTS). */
|
|
130
|
-
lights?: boolean
|
|
136
|
+
lights?: boolean,
|
|
137
|
+
/** The xenomorph's claws on the fingertips (Grip). */
|
|
138
|
+
claws?: boolean) => void;
|
|
131
139
|
/** What a hand does besides closing (hand()): the left index pointing, the right thumb pushing toward `to`, the left thumb cupped. */
|
|
132
140
|
export interface Grip {
|
|
133
141
|
point?: number;
|
|
@@ -136,6 +144,8 @@ export interface Grip {
|
|
|
136
144
|
cup?: number;
|
|
137
145
|
/** The marine's lit buttons on the wrists' straps. */
|
|
138
146
|
lights?: boolean;
|
|
147
|
+
/** The xenomorph's: a hooked claw of bone on each fingertip, for the nail. */
|
|
148
|
+
claws?: boolean;
|
|
139
149
|
}
|
|
140
150
|
/**
|
|
141
151
|
* Both hands of the skeleton `s` on its wrists, left then right, each closed `curls[i]` (hand()), in
|
|
@@ -143,7 +153,7 @@ export interface Grip {
|
|
|
143
153
|
* body and the runners share it, so a runner's fist closes on a grip as the own one does. `lite` is
|
|
144
154
|
* a near runner's hand, `skip` a hand not drawn (the one a cut took off with its arm).
|
|
145
155
|
*/
|
|
146
|
-
export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights }?: Grip, lite?: boolean, skip?: number) => void;
|
|
156
|
+
export declare const hands: (out: Out, s: Solved, build: number, curls: number[], glove: number[], bare: number[], { point, push, to, cup, lights, claws }?: Grip, lite?: boolean, skip?: number) => void;
|
|
147
157
|
/** On a wall run the rail gun is put away, unless its bolt is going out. */
|
|
148
158
|
export declare const stowed: (p: PlayerState) => boolean;
|
|
149
159
|
export declare const createBody: (world?: World) => Body;
|
|
@@ -20,9 +20,16 @@ export declare const GLOW: number, DEAD: number, MORE: number, FRAMES: number;
|
|
|
20
20
|
export declare const frame: (level: number, e: number) => number;
|
|
21
21
|
/** The colours of the palette, RGBA as one number each (little-endian ABGR for ImageData). */
|
|
22
22
|
export declare const PALETTE: number[];
|
|
23
|
+
/** The faces of sprite(): the man's, the woman's and the xenomorph's. */
|
|
24
|
+
export declare const LOOK: {
|
|
25
|
+
readonly MAN: 0;
|
|
26
|
+
readonly WOMAN: 1;
|
|
27
|
+
readonly XENO: 2;
|
|
28
|
+
};
|
|
23
29
|
/**
|
|
24
|
-
* Frame `n`'s pixels, FW by FH palette indices, row by row; built once. `fem` (
|
|
25
|
-
* face: the same frames, a bob over the scalp and down the cheeks, a narrower jaw, lashes,
|
|
30
|
+
* Frame `n`'s pixels, FW by FH palette indices, row by row; built once. `fem` (LOOK.WOMAN) is the
|
|
31
|
+
* woman's face: the same frames, a bob over the scalp and down the cheeks, a narrower jaw, lashes,
|
|
32
|
+
* lips; LOOK.XENO the xenomorph's head (beast()).
|
|
26
33
|
*/
|
|
27
34
|
export declare const sprite: (n: number, fem?: number) => Uint8Array;
|
|
28
35
|
/** What the face reacts to, each frame. */
|
|
@@ -111,8 +111,6 @@ export declare const TONES: number[][];
|
|
|
111
111
|
/** A skin tone for the runner `id`, the same for everyone who sees him. */
|
|
112
112
|
export declare const toneOf: (id: number) => number[];
|
|
113
113
|
/** The skin tone the player picked (`c.tone`, an index of TONES), else his id's. */
|
|
114
|
-
/** The xenomorph's skin on the human runner it is drawn as until it has a body of its own: dark chitin. */
|
|
115
|
-
export declare const CHITIN: number[];
|
|
116
114
|
export declare const toneFor: (id: number, c?: {
|
|
117
115
|
tone?: number;
|
|
118
116
|
}) => number[];
|
|
@@ -42,6 +42,8 @@ export declare const MOVE: {
|
|
|
42
42
|
readonly DOWN: 10;
|
|
43
43
|
/** Seated in a rover: the rough of it, the hands and the feet are placed in `reach`. */
|
|
44
44
|
readonly RIDE: 11;
|
|
45
|
+
/** The xenomorph on a wall (MODE.CLING): facing it, the hands and the feet on it (`reach`). */
|
|
46
|
+
readonly CLING: 12;
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
47
49
|
* A seated body, from the seat point (the player's position, the feet of shared/rover.ts' seat())
|
|
@@ -106,7 +108,7 @@ export declare const LUNGE: {
|
|
|
106
108
|
out: number[];
|
|
107
109
|
twist: number;
|
|
108
110
|
};
|
|
109
|
-
/** The striking arm of each blow (BLOW): -1 the left, 1 the right. */
|
|
111
|
+
/** The striking arm of each blow (BLOW): -1 the left, 1 the right; the xenomorph's claws, and its tail's sting, which takes no arm (0). */
|
|
110
112
|
export declare const SIDE: number[];
|
|
111
113
|
/** Whether the player has no weapon at all: FIRE punches. */
|
|
112
114
|
export declare const bare: (p: PlayerState) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlayerState } from '../shared/types';
|
|
1
|
+
import type { Choice, PlayerState } from '../shared/types';
|
|
2
2
|
import type { World } from '../shared/world';
|
|
3
3
|
import type { Tracer } from './beams';
|
|
4
4
|
import type { Gait } from './gait';
|
|
@@ -51,6 +51,7 @@ export declare const track: (r: {
|
|
|
51
51
|
gait: Pick<Gait, "pose">;
|
|
52
52
|
cut?: Piece;
|
|
53
53
|
build?: number;
|
|
54
|
+
look?: Choice;
|
|
54
55
|
}, dt: number, floor: Ground, fresh: boolean, tracer?: Pick<Tracer, "shock" | "spit">) => void;
|
|
55
56
|
/**
|
|
56
57
|
* Appends the piece at level of detail `lod`, in `colors` (see palette()), sunk by `sink` metres with
|
|
@@ -12,6 +12,10 @@ export declare const REGION: {
|
|
|
12
12
|
STRIPE_LOW: number;
|
|
13
13
|
BELT: number;
|
|
14
14
|
HAIR: number;
|
|
15
|
+
JACKET: number;
|
|
16
|
+
TRIM: number;
|
|
17
|
+
SOLE: number;
|
|
18
|
+
CAP: number;
|
|
15
19
|
};
|
|
16
20
|
/** The palette's colours that glow, unlit (the eyes' specks, a cut's face), and its size. */
|
|
17
21
|
export declare const UNLIT: number[], COLOURS: number;
|
|
@@ -106,6 +110,8 @@ export declare const BUST_Y = 1.37;
|
|
|
106
110
|
* Only the far one has hands, mittens: the others end at the wrists, where hands() goes. Built once.
|
|
107
111
|
*/
|
|
108
112
|
export declare const body: (lod: number, build?: number) => Skin;
|
|
113
|
+
/** The xenomorph's skin at a level of detail, as body()'s: on the man's joints and binds, no face. */
|
|
114
|
+
export declare const beast: (lod: number) => Skin;
|
|
109
115
|
/**
|
|
110
116
|
* The skin at a level of detail without the LIMB `limb`, then the limb alone, each closed by a
|
|
111
117
|
* glowing cut face whose middle is the last vertex of the last triangle. Built once.
|
|
@@ -133,11 +133,6 @@ export declare const fried: (p: PlayerState) => number;
|
|
|
133
133
|
* thins to nothing.
|
|
134
134
|
*/
|
|
135
135
|
export declare const dissolve: (out: Out, from: number, k: number) => void;
|
|
136
|
-
/**
|
|
137
|
-
* Appends a runner at level of detail `lod` (see body(): 0 far, 1 near, 3 close; its weapon is near
|
|
138
|
-
* when the runner is close): the jacket in `color` (r, g, b), dark
|
|
139
|
-
* trousers, skin, hair in his own colour (hairOf()) and light shoes, posed by its gait. A dash trails a few glowing streaks.
|
|
140
|
-
*/
|
|
141
136
|
/** The runner's pose this frame, solved: the gait, the fall and sink of one down, and the weapon's hold; and the way the body faces. */
|
|
142
137
|
export declare const stance: (r: Runner) => {
|
|
143
138
|
s: {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { Vec3 } from './mesh';
|
|
2
|
+
import type { Quat } from './rig';
|
|
3
|
+
import type { Out } from './verts';
|
|
4
|
+
/** Its chitin: a near black with a cold sheen. */
|
|
5
|
+
export declare const CHITIN_X: number[];
|
|
6
|
+
/** Metres: the tail's length, its root's radius and its tip's, the stinger's length. */
|
|
7
|
+
export declare const TAIL: {
|
|
8
|
+
len: number;
|
|
9
|
+
root: number;
|
|
10
|
+
tip: number;
|
|
11
|
+
sting: number;
|
|
12
|
+
};
|
|
13
|
+
/** A solved skeleton (solve() in rig.ts): each joint's place and turn in the world. */
|
|
14
|
+
interface Solved {
|
|
15
|
+
pos: Vec3[];
|
|
16
|
+
rot: Quat[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Its spine, in the world, from the base of the skull down the back and on into the tail (the user,
|
|
20
|
+
* 2026-11-15: vertebrae linked to one another, from the tail up the back to the head): one chain of
|
|
21
|
+
* vertebrae, each a bead pinched at its joints with a spine standing out of it, on the back half
|
|
22
|
+
* sunk in the skin, the tail free. The tail bends from down and back up to its tip, sways with the
|
|
23
|
+
* clock `t` and more with the speed `run` (0 to 1); `sting` (0 to 1) arches it up over the back and
|
|
24
|
+
* forward past the head. The stinger glows in the team's `color`. `lod` 0 far, 1 near, 2 close.
|
|
25
|
+
*/
|
|
26
|
+
export declare const column: (out: Out, s: Solved, t: number, run: number, sting: number, color: number[], lod: number) => void;
|
|
27
|
+
/** Bone: its claws. */
|
|
28
|
+
export declare const BONE: number[];
|
|
29
|
+
/** Where the metatarsal (the foot) ends, from the ankle, in the foot joint's frame: longer than the rig's foot. */
|
|
30
|
+
export declare const FOOT_TIP: Vec3;
|
|
31
|
+
/**
|
|
32
|
+
* Its foot on a foot joint (the user, 2026-11-15: an arched sole, tendons and toes): a round ankle
|
|
33
|
+
* over the joint, which the shin's end sinks into, then the bone bowing up along its top into an
|
|
34
|
+
* arch, a pad under the heel and one under the ball at its end (FOOT_TIP); three tendons stand out
|
|
35
|
+
* over the instep from the ankle to the toes, where toes() carries them on to the claws. The pose
|
|
36
|
+
* stands it near upright (prowl() in soldier.ts): a third segment to the leg.
|
|
37
|
+
*/
|
|
38
|
+
export declare const metatarsal: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Its toes at the end of the foot (FOOT_TIP), level: three long digits splayed forward and a fourth,
|
|
41
|
+
* short, behind. Each is two phalanges with a knuckle standing up between them, its tendon along
|
|
42
|
+
* its top, and at its end a big hooked claw of bone curving down past the toe.
|
|
43
|
+
*/
|
|
44
|
+
export declare const toes: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
45
|
+
/** Its tendons on a shin joint: the heel's cord down the back of the shin, and one down each side of its front. */
|
|
46
|
+
export declare const sinews: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Its rib cage on the chest joint, standing out of a starved trunk in a lighter chitin: five pairs of ribs from the
|
|
49
|
+
* spine round to the breastbone, each sloping down toward the front, the lower ones shorter, and
|
|
50
|
+
* the keel of the breastbone down the middle. Each row: the height at the spine, the half width and
|
|
51
|
+
* the half depth of the arch (a hair outside the skin's).
|
|
52
|
+
*/
|
|
53
|
+
export declare const ribs: (out: Out, at: Vec3, q: Quat, lod: number, low?: boolean) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Its collarbones on the chest joint (the user, 2026-11-15: standing out, an exoskeleton), in the
|
|
56
|
+
* ribs' chitin: from the notch over the breastbone forward and out, then back to a knob over each
|
|
57
|
+
* shoulder.
|
|
58
|
+
*/
|
|
59
|
+
export declare const clavicles: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Thin pipes up its neck (the user, 2026-11-15: following the neck, in curves, many): six each side,
|
|
62
|
+
* from the top of the chest round the neck's sides into the underside of the skull, each through
|
|
63
|
+
* points carried by the chest, the neck and the head, so it bends with them, on a smooth curve
|
|
64
|
+
* that snakes round the neck. In the world, from the solved skeleton `s`.
|
|
65
|
+
*/
|
|
66
|
+
export declare const pipes: (out: Out, s: Solved, lod: number) => void;
|
|
67
|
+
/**
|
|
68
|
+
* Curved horns out of its back (the user, 2026-11-15): a pair on a joint, each from beside the spine
|
|
69
|
+
* out of the back near square to it and well out to the side, clear of the head, curling up a little, `len` long and `r` thick at its root, at `base` (the right
|
|
70
|
+
* one) in the joint's frame.
|
|
71
|
+
*/
|
|
72
|
+
export declare const horns: (out: Out, at: Vec3, q: Quat, lod: number, base: Vec3, len: number, r: number) => void;
|
|
73
|
+
/** The three pairs of horns: the joint, the root, the length and thickness, small low, large high. */
|
|
74
|
+
export declare const HORNS: [number, Vec3, number, number][];
|
|
75
|
+
/** Its spurs: one out of the back of each elbow (a forearm joint), one out of the back of each ankle (a shin joint). */
|
|
76
|
+
export declare const elbow: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
77
|
+
export declare const heel: (out: Out, at: Vec3, q: Quat, lod: number) => void;
|
|
78
|
+
/** Its head's chitin: the dome's (the skin's TRIM, soldier.ts) and its face's, one colour. */
|
|
79
|
+
export declare const HEAD: number[];
|
|
80
|
+
/**
|
|
81
|
+
* The head's front (the user, 2026-11-15: one smooth block with the back): an ellipsoid round the
|
|
82
|
+
* middle of the head, its centre's height and its half width, height and depth. Its rim is the
|
|
83
|
+
* dome's front ring (CREST in skin.ts), so the face, as wide as it at every height, meets the dome
|
|
84
|
+
* with no seam; over the orbits the face is the ellipsoid itself, a smooth forehead.
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* How far the head is carried over its joint (the user, 2026-11-15: a neck that shows): the face
|
|
88
|
+
* here, the dome in skin.ts (PROFILE), the neck's skin run up to it.
|
|
89
|
+
*/
|
|
90
|
+
export declare const HEAD_UP = 0.065;
|
|
91
|
+
/**
|
|
92
|
+
* The face of its skull, a human skull's in its chitin: a forehead a smooth sphere, the
|
|
93
|
+
* orbits sunk, the cheekbones, no nose; the mouth an opening whose edge the lips hide, dark inside,
|
|
94
|
+
* with grey teeth, the fangs longest. A grid over the face, finer the closer.
|
|
95
|
+
*/
|
|
96
|
+
export declare const skull: (out: Out, head: Vec3, q: Quat, lod: number) => void;
|
|
97
|
+
/** Its eyes, glowing slits at the back of the orbits in the team's `color`. */
|
|
98
|
+
export declare const eyes: (out: Out, head: Vec3, q: Quat, color: number[]) => void;
|
|
99
|
+
export {};
|
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.163.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|