@zylem/game-lib 0.6.2 → 0.6.3
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/LICENSE +21 -0
- package/README.md +9 -16
- package/dist/actions.d.ts +30 -21
- package/dist/actions.js +628 -145
- package/dist/actions.js.map +1 -1
- package/dist/behavior/platformer-3d.d.ts +296 -0
- package/dist/behavior/platformer-3d.js +518 -0
- package/dist/behavior/platformer-3d.js.map +1 -0
- package/dist/behavior/ricochet-2d.d.ts +274 -0
- package/dist/behavior/ricochet-2d.js +394 -0
- package/dist/behavior/ricochet-2d.js.map +1 -0
- package/dist/behavior/screen-wrap.d.ts +86 -0
- package/dist/behavior/screen-wrap.js +195 -0
- package/dist/behavior/screen-wrap.js.map +1 -0
- package/dist/behavior/thruster.d.ts +10 -0
- package/dist/behavior/thruster.js +234 -0
- package/dist/behavior/thruster.js.map +1 -0
- package/dist/behavior/world-boundary-2d.d.ts +141 -0
- package/dist/behavior/world-boundary-2d.js +181 -0
- package/dist/behavior/world-boundary-2d.js.map +1 -0
- package/dist/behavior-descriptor-BWNWmIjv.d.ts +142 -0
- package/dist/{blueprints-Cq3Ko6_G.d.ts → blueprints-BWGz8fII.d.ts} +2 -2
- package/dist/camera-B5e4c78l.d.ts +468 -0
- package/dist/camera.d.ts +3 -2
- package/dist/camera.js +900 -211
- package/dist/camera.js.map +1 -1
- package/dist/composition-DrzFrbqI.d.ts +218 -0
- package/dist/{core-bO8TzV7u.d.ts → core-DAkskq6Y.d.ts} +60 -62
- package/dist/core.d.ts +10 -6
- package/dist/core.js +6896 -5020
- package/dist/core.js.map +1 -1
- package/dist/{entities-DvByhMGU.d.ts → entities-DC9ce_vx.d.ts} +113 -3
- package/dist/entities.d.ts +5 -3
- package/dist/entities.js +3727 -3167
- package/dist/entities.js.map +1 -1
- package/dist/entity-BpbZqg19.d.ts +1100 -0
- package/dist/global-change-Dc8uCKi2.d.ts +25 -0
- package/dist/main.d.ts +418 -15
- package/dist/main.js +11384 -8515
- package/dist/main.js.map +1 -1
- package/dist/{stage-types-Bd-KtcYT.d.ts → stage-types-BFsm3qsZ.d.ts} +205 -13
- package/dist/stage.d.ts +10 -7
- package/dist/stage.js +5311 -3880
- package/dist/stage.js.map +1 -1
- package/dist/thruster-DhRaJnoL.d.ts +172 -0
- package/dist/world-Be5m1XC1.d.ts +31 -0
- package/package.json +29 -13
- package/dist/behaviors.d.ts +0 -854
- package/dist/behaviors.js +0 -1209
- package/dist/behaviors.js.map +0 -1
- package/dist/camera-CeJPAgGg.d.ts +0 -116
- package/dist/moveable-B_vyA6cw.d.ts +0 -67
- package/dist/transformable-CUhvyuYO.d.ts +0 -67
- package/dist/world-C8tQ7Plj.d.ts +0 -774
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as GameEntity, P as GameEntityOptions, U as UpdateContext, M as DestroyContext, N as BaseNode, as as TexturePath, V as Vec3, R as MaterialOptions } from './entity-BpbZqg19.js';
|
|
2
2
|
import { Vector3, Sprite, Color, Vector2, Object3D } from 'three';
|
|
3
|
+
import { C as CollisionHandlerDelegate } from './world-Be5m1XC1.js';
|
|
3
4
|
|
|
4
5
|
type SpriteImage = {
|
|
5
6
|
name: string;
|
|
@@ -99,6 +100,12 @@ declare class ZylemRect extends GameEntity<ZylemRectOptions> {
|
|
|
99
100
|
getHeight(): number;
|
|
100
101
|
private roundedRectPath;
|
|
101
102
|
private toCssColor;
|
|
103
|
+
/**
|
|
104
|
+
* Get the viewport resolution from the renderer DOM element,
|
|
105
|
+
* falling back to the camera's screenResolution if the renderer
|
|
106
|
+
* is not available (e.g. when using the new RendererManager path).
|
|
107
|
+
*/
|
|
108
|
+
private getResolution;
|
|
102
109
|
private rectSetup;
|
|
103
110
|
private rectUpdate;
|
|
104
111
|
private updateStickyTransform;
|
|
@@ -163,7 +170,7 @@ declare class ZylemBox extends GameEntity<ZylemBoxOptions> {
|
|
|
163
170
|
constructor(options?: ZylemBoxOptions);
|
|
164
171
|
buildInfo(): Record<string, any>;
|
|
165
172
|
}
|
|
166
|
-
type BoxOptions = BaseNode | ZylemBoxOptions
|
|
173
|
+
type BoxOptions = BaseNode | Partial<ZylemBoxOptions>;
|
|
167
174
|
declare function createBox(...args: Array<BoxOptions>): ZylemBox;
|
|
168
175
|
|
|
169
176
|
type ZylemPlaneOptions = GameEntityOptions & {
|
|
@@ -303,4 +310,107 @@ declare class ZylemActor extends GameEntity<ZylemActorOptions> implements Entity
|
|
|
303
310
|
type ActorOptions = BaseNode | ZylemActorOptions;
|
|
304
311
|
declare function createActor(...args: Array<ActorOptions>): ZylemActor;
|
|
305
312
|
|
|
306
|
-
|
|
313
|
+
type ZylemConeOptions = GameEntityOptions & {
|
|
314
|
+
/** Base radius of the cone */
|
|
315
|
+
radius?: number;
|
|
316
|
+
/** Height of the cone */
|
|
317
|
+
height?: number;
|
|
318
|
+
/** Number of radial segments (higher = smoother) */
|
|
319
|
+
radialSegments?: number;
|
|
320
|
+
};
|
|
321
|
+
declare const CONE_TYPE: unique symbol;
|
|
322
|
+
/**
|
|
323
|
+
* A cone entity with configurable radius, height, and radial segments.
|
|
324
|
+
* Uses a Rapier cone collider for physics.
|
|
325
|
+
*/
|
|
326
|
+
declare class ZylemCone extends GameEntity<ZylemConeOptions> {
|
|
327
|
+
static type: symbol;
|
|
328
|
+
constructor(options?: ZylemConeOptions);
|
|
329
|
+
buildInfo(): Record<string, any>;
|
|
330
|
+
}
|
|
331
|
+
type ConeOptions = BaseNode | Partial<ZylemConeOptions>;
|
|
332
|
+
/**
|
|
333
|
+
* Create a cone entity.
|
|
334
|
+
* @param args Options or child nodes
|
|
335
|
+
*/
|
|
336
|
+
declare function createCone(...args: Array<ConeOptions>): ZylemCone;
|
|
337
|
+
|
|
338
|
+
type ZylemPyramidOptions = GameEntityOptions & {
|
|
339
|
+
/** Base radius of the pyramid */
|
|
340
|
+
radius?: number;
|
|
341
|
+
/** Height of the pyramid */
|
|
342
|
+
height?: number;
|
|
343
|
+
};
|
|
344
|
+
declare const PYRAMID_TYPE: unique symbol;
|
|
345
|
+
/**
|
|
346
|
+
* A pyramid entity (4-sided cone).
|
|
347
|
+
* Uses ConeGeometry with 4 radial segments for the visual mesh
|
|
348
|
+
* and a Rapier cone collider for physics.
|
|
349
|
+
*/
|
|
350
|
+
declare class ZylemPyramid extends GameEntity<ZylemPyramidOptions> {
|
|
351
|
+
static type: symbol;
|
|
352
|
+
constructor(options?: ZylemPyramidOptions);
|
|
353
|
+
buildInfo(): Record<string, any>;
|
|
354
|
+
}
|
|
355
|
+
type PyramidOptions = BaseNode | Partial<ZylemPyramidOptions>;
|
|
356
|
+
/**
|
|
357
|
+
* Create a pyramid entity.
|
|
358
|
+
* @param args Options or child nodes
|
|
359
|
+
*/
|
|
360
|
+
declare function createPyramid(...args: Array<PyramidOptions>): ZylemPyramid;
|
|
361
|
+
|
|
362
|
+
type ZylemCylinderOptions = GameEntityOptions & {
|
|
363
|
+
/** Top radius of the cylinder */
|
|
364
|
+
radiusTop?: number;
|
|
365
|
+
/** Bottom radius of the cylinder */
|
|
366
|
+
radiusBottom?: number;
|
|
367
|
+
/** Height of the cylinder */
|
|
368
|
+
height?: number;
|
|
369
|
+
/** Number of radial segments (higher = smoother) */
|
|
370
|
+
radialSegments?: number;
|
|
371
|
+
};
|
|
372
|
+
declare const CYLINDER_TYPE: unique symbol;
|
|
373
|
+
/**
|
|
374
|
+
* A cylinder entity with configurable top/bottom radii, height, and segments.
|
|
375
|
+
* Uses a Rapier cylinder collider for physics.
|
|
376
|
+
*/
|
|
377
|
+
declare class ZylemCylinder extends GameEntity<ZylemCylinderOptions> {
|
|
378
|
+
static type: symbol;
|
|
379
|
+
constructor(options?: ZylemCylinderOptions);
|
|
380
|
+
buildInfo(): Record<string, any>;
|
|
381
|
+
}
|
|
382
|
+
type CylinderOptions = BaseNode | Partial<ZylemCylinderOptions>;
|
|
383
|
+
/**
|
|
384
|
+
* Create a cylinder entity.
|
|
385
|
+
* @param args Options or child nodes
|
|
386
|
+
*/
|
|
387
|
+
declare function createCylinder(...args: Array<CylinderOptions>): ZylemCylinder;
|
|
388
|
+
|
|
389
|
+
type ZylemPillOptions = GameEntityOptions & {
|
|
390
|
+
/** Radius of the capsule hemispheres */
|
|
391
|
+
radius?: number;
|
|
392
|
+
/** Length of the cylindrical middle section */
|
|
393
|
+
length?: number;
|
|
394
|
+
/** Number of cap segments (higher = smoother) */
|
|
395
|
+
capSegments?: number;
|
|
396
|
+
/** Number of radial segments (higher = smoother) */
|
|
397
|
+
radialSegments?: number;
|
|
398
|
+
};
|
|
399
|
+
declare const PILL_TYPE: unique symbol;
|
|
400
|
+
/**
|
|
401
|
+
* A pill/capsule entity with configurable radius and cylindrical length.
|
|
402
|
+
* Uses Three.js CapsuleGeometry for rendering and Rapier capsule collider for physics.
|
|
403
|
+
*/
|
|
404
|
+
declare class ZylemPill extends GameEntity<ZylemPillOptions> {
|
|
405
|
+
static type: symbol;
|
|
406
|
+
constructor(options?: ZylemPillOptions);
|
|
407
|
+
buildInfo(): Record<string, any>;
|
|
408
|
+
}
|
|
409
|
+
type PillOptions = BaseNode | Partial<ZylemPillOptions>;
|
|
410
|
+
/**
|
|
411
|
+
* Create a pill (capsule) entity.
|
|
412
|
+
* @param args Options or child nodes
|
|
413
|
+
*/
|
|
414
|
+
declare function createPill(...args: Array<PillOptions>): ZylemPill;
|
|
415
|
+
|
|
416
|
+
export { ACTOR_TYPE as A, BOX_TYPE as B, CONE_TYPE as C, createCylinder as D, createPill as E, PLANE_TYPE as P, RECT_TYPE as R, SPRITE_TYPE as S, TEXT_TYPE as T, ZylemSprite as Z, SPHERE_TYPE as a, ZylemSphere as b, ZylemRect as c, ZylemText as d, ZylemBox as e, ZylemPlane as f, ZONE_TYPE as g, ZylemZone as h, ZylemActor as i, ZylemCone as j, PYRAMID_TYPE as k, ZylemPyramid as l, CYLINDER_TYPE as m, ZylemCylinder as n, PILL_TYPE as o, ZylemPill as p, createBox as q, createSphere as r, createSprite as s, createPlane as t, createZone as u, createActor as v, createText as w, createRect as x, createCone as y, createPyramid as z };
|
package/dist/entities.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { e as ZylemBox,
|
|
2
|
-
import './
|
|
1
|
+
export { e as ZylemBox, v as createActor, q as createBox, y as createCone, D as createCylinder, E as createPill, t as createPlane, z as createPyramid, x as createRect, r as createSphere, s as createSprite, w as createText, u as createZone } from './entities-DC9ce_vx.js';
|
|
2
|
+
import './entity-BpbZqg19.js';
|
|
3
3
|
import 'three';
|
|
4
4
|
import '@dimforge/rapier3d-compat';
|
|
5
|
-
import './entity-Bq_eNEDI.js';
|
|
6
5
|
import 'bitecs';
|
|
7
6
|
import 'mitt';
|
|
7
|
+
import './behavior-descriptor-BWNWmIjv.js';
|
|
8
|
+
import './world-Be5m1XC1.js';
|
|
9
|
+
import './entity-Bq_eNEDI.js';
|