@korial29/tiny-fps 0.145.0 → 0.145.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.
- package/dist/index.js +16 -16
- package/dist/types/client/armor.d.ts +15 -1
- package/dist/types/client/beams.d.ts +2 -1
- package/dist/types/client/body.d.ts +4 -3
- package/dist/types/client/buckle.d.ts +2 -1
- package/dist/types/client/craft.d.ts +2 -1
- package/dist/types/client/doors.d.ts +3 -2
- package/dist/types/client/drops.d.ts +2 -1
- package/dist/types/client/dust.d.ts +2 -1
- package/dist/types/client/flag.d.ts +6 -5
- package/dist/types/client/gun.d.ts +3 -2
- package/dist/types/client/hair.d.ts +2 -1
- package/dist/types/client/helm.d.ts +2 -1
- package/dist/types/client/helmet.d.ts +5 -4
- package/dist/types/client/katana.d.ts +4 -3
- package/dist/types/client/limbs.d.ts +2 -1
- package/dist/types/client/mask.d.ts +5 -2
- package/dist/types/client/mesh.d.ts +4 -3
- package/dist/types/client/moonbase.d.ts +6 -5
- package/dist/types/client/pack.d.ts +4 -3
- package/dist/types/client/pads.d.ts +5 -2
- package/dist/types/client/pouch.d.ts +2 -1
- package/dist/types/client/props.d.ts +6 -5
- package/dist/types/client/render.d.ts +2 -1
- package/dist/types/client/rover.d.ts +3 -2
- package/dist/types/client/skin.d.ts +2 -1
- package/dist/types/client/soldier.d.ts +3 -2
- package/dist/types/client/traffic.d.ts +2 -1
- package/dist/types/client/trail.d.ts +2 -1
- package/dist/types/client/verts.d.ts +26 -0
- package/dist/types/client/vision.d.ts +2 -1
- package/dist/types/client/wreck.d.ts +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Where the vertices go: a plain array (the tests, the meshes built once) or the frame's Verts. */
|
|
2
|
+
export type Out = number[] | Verts;
|
|
3
|
+
/** Numbers written and read by index: a plain array or a Verts' store. */
|
|
4
|
+
export interface Floats {
|
|
5
|
+
[i: number]: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The frame's vertices in a store that only grows. Doubles, as a plain array holds them: what is
|
|
9
|
+
* read back (the armour off the skin) comes out the same, and the upload rounds them to floats.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Verts {
|
|
12
|
+
a: Float64Array<ArrayBuffer>;
|
|
13
|
+
/** The numbers written: the next goes there. Set it lower to drop the last ones. */
|
|
14
|
+
length: number;
|
|
15
|
+
/** Makes room for `n` numbers more and returns the store to write them in. */
|
|
16
|
+
room(n: number): Float64Array;
|
|
17
|
+
push(...v: number[]): void;
|
|
18
|
+
/** The numbers from `from` to `to` (at most the length), as an array. */
|
|
19
|
+
slice(from: number, to: number): number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Makes room in `out` for `n` numbers more and returns where to write them by index, from
|
|
23
|
+
* `out.length` on. Set `out.length` to the end of what was written afterwards: a Verts does not
|
|
24
|
+
* count by itself (a plain array does, and the assignment is then a no-op).
|
|
25
|
+
*/
|
|
26
|
+
export declare const room: (out: Out, n: number) => Floats;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Brush, WorldDef } from '../shared/world';
|
|
2
2
|
import type { Vec3 } from './mesh';
|
|
3
|
+
import type { Out } from './verts';
|
|
3
4
|
/** A side of a brush: its axis (0 x, 2 z) and 1 for its max, 0 for its min. */
|
|
4
5
|
export type Side = [axis: number, up: number];
|
|
5
6
|
export interface Use {
|
|
@@ -13,7 +14,7 @@ export interface Use {
|
|
|
13
14
|
/** What a runner can use on brush `b` of the world `def`. */
|
|
14
15
|
export declare const uses: ({ brushes, floor }: WorldDef, b: Brush) => Use;
|
|
15
16
|
/** One face of the box min..max (flat on `axis` when min and max agree there) as two triangles, pushed in the map's vertex format. */
|
|
16
|
-
export declare const face: (out:
|
|
17
|
+
export declare const face: (out: Out, min: Vec3, max: Vec3, axis: number, up: number, layer: number, rgb: number[]) => void;
|
|
17
18
|
/** The red of every use in the world, in the map's vertex format (layer -2 glows, -1 is lit). Not on ghosts: nothing shows them. */
|
|
18
19
|
export declare const vision: (def: WorldDef) => number[];
|
|
19
20
|
/** A square on each team's roof around its base, lit paint of the team's colour: pale inside, a strong frame. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Rover } from '../shared/types';
|
|
2
2
|
import type { World } from '../shared/world';
|
|
3
3
|
import type { Vec3 } from './mesh';
|
|
4
|
+
import type { Out } from './verts';
|
|
4
5
|
/**
|
|
5
6
|
* Where a hull arcs, right of the vehicle's centre, above it and ahead of it, each on the model: a
|
|
6
7
|
* rover's (the four wheels' arms, the nose, the rear deck, the two lasers, the dashboard, the roll
|
|
@@ -29,7 +30,7 @@ export declare const sparking: (r: Rover, k: number, slot: number) => [Vec3, Vec
|
|
|
29
30
|
* last VEHICLE.FADE ticks it falls apart into embers. One just parked afresh (`wreck` below 0)
|
|
30
31
|
* shimmers in.
|
|
31
32
|
*/
|
|
32
|
-
export declare const char: (out:
|
|
33
|
+
export declare const char: (out: Out, from: number, r: Rover, k?: number) => void;
|
|
33
34
|
/** What plays a vehicle's damage: the tracer's bolts, fireballs and sparks, the sounds, the camera's shake. */
|
|
34
35
|
export interface Stage {
|
|
35
36
|
tracer: {
|
|
@@ -54,7 +55,7 @@ export interface Wrecks {
|
|
|
54
55
|
*/
|
|
55
56
|
frame(rovers: Rover[], dt: number, eye?: Vec3): Rover[];
|
|
56
57
|
/** Appends the debris and the smoke. */
|
|
57
|
-
draw(out:
|
|
58
|
+
draw(out: Out): void;
|
|
58
59
|
/** Debris and puffs in flight. */
|
|
59
60
|
readonly count: number;
|
|
60
61
|
}
|
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.145.
|
|
5
|
+
"version": "0.145.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|