@korial29/tiny-fps 0.12.0 → 0.14.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 +15 -10
- package/dist/index.js +30 -15
- package/dist/local.js +1 -1
- package/dist/server.js +919 -344
- package/dist/types/client/effects.d.ts +1 -12
- package/dist/types/client/index.d.ts +2 -1
- package/dist/types/client/input.d.ts +2 -2
- package/dist/types/client/lights.d.ts +6 -16
- package/dist/types/client/predict.d.ts +12 -2
- package/dist/types/client/render.d.ts +43 -16
- package/dist/types/shared/constants.d.ts +91 -0
- package/dist/types/shared/map.d.ts +17 -10
- package/dist/types/shared/physics.d.ts +32 -13
- package/dist/types/shared/protocol.d.ts +1 -1
- package/dist/types/shared/room.d.ts +4 -3
- package/dist/types/shared/types.d.ts +81 -63
- package/dist/types/shared/world.d.ts +59 -0
- package/package.json +1 -1
- package/dist/types/shared/level.d.ts +0 -13
- package/dist/types/shared/trace.d.ts +0 -12
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.14.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Level, MapDef, Sector } from './types';
|
|
2
|
-
/** Joins every edge a→b with the sector that has b→a, if any: that edge is a portal. */
|
|
3
|
-
export declare const compile: (map: MapDef) => Level;
|
|
4
|
-
/** Whether (x, z) is inside the sector, its edges included. */
|
|
5
|
-
export declare const inside: ({ pts }: Sector, x: number, z: number) => boolean;
|
|
6
|
-
/** Index of the first sector holding (x, z), -1 outside the map. */
|
|
7
|
-
export declare const sectorAt: ({ map }: Level, x: number, z: number) => number;
|
|
8
|
-
/**
|
|
9
|
-
* Whether a wall, a step or a ceiling hides b from a (both inside the map). Between two edge
|
|
10
|
-
* crossings the segment stays in one sector, and each crossing is checked against the opening of
|
|
11
|
-
* its portal, so floors and ceilings need no test of their own.
|
|
12
|
-
*/
|
|
13
|
-
export declare const blocked: ({ map, edges }: Level, [ax, ay, az]: [number, number, number], [bx, by, bz]: [number, number, number]) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Level } from './types';
|
|
2
|
-
type Vec3 = [number, number, number];
|
|
3
|
-
/**
|
|
4
|
-
* Distance along the ray from o (inside the map) in the unit direction d to the first wall, step
|
|
5
|
-
* face, floor or ceiling, at most max.
|
|
6
|
-
*
|
|
7
|
-
* Walks the sectors: in the current convex one the ray leaves through the edge with the least
|
|
8
|
-
* crossing distance among the edges it goes outward through, or ends earlier on the floor or the
|
|
9
|
-
* ceiling. A solid edge, or a portal whose opening does not hold the crossing height, ends it.
|
|
10
|
-
*/
|
|
11
|
-
export declare const trace: (lvl: Level, o: Vec3, d: Vec3, max: number) => number;
|
|
12
|
-
export {};
|