@zylem/game-lib 0.6.4 → 0.8.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.
Files changed (156) hide show
  1. package/README.md +18 -2
  2. package/dist/actions.d.ts +321 -11
  3. package/dist/actions.js +1 -936
  4. package/dist/api/game-lib.api.json +54074 -0
  5. package/dist/api/game-lib.api.md +4544 -0
  6. package/dist/api/game-lib.d.ts +8258 -0
  7. package/dist/api/game-lib.typedoc.json +345421 -0
  8. package/dist/audio.d.ts +13 -0
  9. package/dist/audio.js +1 -0
  10. package/dist/base-node-life-cycle-D2NuN1VB.d.ts +151 -0
  11. package/dist/behavior.d.ts +2 -0
  12. package/dist/behavior.js +1 -0
  13. package/dist/blueprints-TbGY-h53.d.ts +162 -0
  14. package/dist/chunk-4QLJUQSJ.js +1 -0
  15. package/dist/chunk-7FR5JSQ2.js +1 -0
  16. package/dist/chunk-7GYFZKK7.js +1 -0
  17. package/dist/chunk-7WRQ2UAN.js +1 -0
  18. package/dist/chunk-BH53MBAZ.js +1 -0
  19. package/dist/chunk-BIGH6D34.js +0 -0
  20. package/dist/chunk-CM5YRNBJ.js +19 -0
  21. package/dist/chunk-COM6HJ2L.js +1 -0
  22. package/dist/chunk-D2PATZCC.js +1 -0
  23. package/dist/chunk-DFLI7ICU.js +0 -0
  24. package/dist/chunk-E3UBSUPX.js +1 -0
  25. package/dist/chunk-FKIKN7RP.js +24 -0
  26. package/dist/chunk-G4HONLWC.js +1 -0
  27. package/dist/chunk-IKWE2W6L.js +1 -0
  28. package/dist/chunk-IPWUDOV5.js +1 -0
  29. package/dist/chunk-JEHFHUH4.js +0 -0
  30. package/dist/chunk-JNKPTL77.js +1 -0
  31. package/dist/chunk-JQKS42G4.js +1 -0
  32. package/dist/chunk-M3XNO56P.js +1 -0
  33. package/dist/chunk-MSC2BEO5.js +1 -0
  34. package/dist/chunk-ORIDWL3T.js +0 -0
  35. package/dist/chunk-QB3NL7VQ.js +1 -0
  36. package/dist/chunk-QXVH6POE.js +1 -0
  37. package/dist/chunk-RXDTAWI2.js +29 -0
  38. package/dist/chunk-TAUWDQZF.js +9 -0
  39. package/dist/chunk-VS2D4B3W.js +1 -0
  40. package/dist/chunk-WQ3WMMZD.js +1 -0
  41. package/dist/chunk-XK63E4SX.js +1 -0
  42. package/dist/chunk-XNDS4YFR.js +1 -0
  43. package/dist/chunk-XNHVRFAK.js +1 -0
  44. package/dist/chunk-XRP4JJXL.js +1 -0
  45. package/dist/chunk-YHEWKN7N.js +1 -0
  46. package/dist/chunk-ZRT3ZQVH.js +1 -0
  47. package/dist/collision-builder-jF-toPIl.d.ts +38 -0
  48. package/dist/core.d.ts +223 -16
  49. package/dist/core.js +1 -12424
  50. package/dist/debug-state-BPT6jEog.d.ts +17 -0
  51. package/dist/debug.d.ts +76 -0
  52. package/dist/debug.js +1 -0
  53. package/dist/default-controls-0-vCnli7.d.ts +111 -0
  54. package/dist/{entity-vj-HTjzU.d.ts → entity-BdSI8CL3.d.ts} +119 -626
  55. package/dist/{entity-Bq_eNEDI.d.ts → entity-DZbFQ1Wg.d.ts} +4 -4
  56. package/dist/entity-type-map-Bd69SpAS.d.ts +928 -0
  57. package/dist/entity.d.ts +268 -0
  58. package/dist/entity.js +1 -0
  59. package/dist/events.d.ts +181 -0
  60. package/dist/events.js +1 -0
  61. package/dist/game-C1FHVqXl.d.ts +1886 -0
  62. package/dist/game-default-QHROHW2O.js +1 -0
  63. package/dist/game-interfaces-mchNYSZE.d.ts +90 -0
  64. package/dist/globals.d.ts +115 -0
  65. package/dist/globals.js +1 -0
  66. package/dist/graphics.d.ts +53 -0
  67. package/dist/graphics.js +1 -0
  68. package/dist/input-ui.d.ts +35 -0
  69. package/dist/input-ui.js +1 -0
  70. package/dist/input.d.ts +73 -0
  71. package/dist/input.js +1 -0
  72. package/dist/material-9vJ6SZaI.d.ts +126 -0
  73. package/dist/public.d.ts +38 -0
  74. package/dist/public.js +1 -0
  75. package/dist/runtime.d.ts +59 -0
  76. package/dist/runtime.js +1 -0
  77. package/dist/schema/entity.schema.json +244 -0
  78. package/dist/schema/game-config.schema.json +625 -0
  79. package/dist/schema/input-config.schema.json +499 -0
  80. package/dist/schema/stage-config.schema.json +93 -0
  81. package/dist/schema/stage.schema.json +271 -0
  82. package/dist/schema.d.ts +538 -0
  83. package/dist/schema.js +1 -0
  84. package/dist/stage-transition-CmGpV4tc.d.ts +46 -0
  85. package/dist/vector-CiSHbivc.d.ts +133 -0
  86. package/dist/web-components.d.ts +70 -0
  87. package/dist/web-components.js +1 -0
  88. package/dist/zylem-camera-C3bn6BTI.d.ts +575 -0
  89. package/package.json +70 -73
  90. package/dist/actions.js.map +0 -1
  91. package/dist/behavior/jumper-2d.d.ts +0 -114
  92. package/dist/behavior/jumper-2d.js +0 -711
  93. package/dist/behavior/jumper-2d.js.map +0 -1
  94. package/dist/behavior/platformer-3d.d.ts +0 -296
  95. package/dist/behavior/platformer-3d.js +0 -761
  96. package/dist/behavior/platformer-3d.js.map +0 -1
  97. package/dist/behavior/ricochet-2d.d.ts +0 -275
  98. package/dist/behavior/ricochet-2d.js +0 -425
  99. package/dist/behavior/ricochet-2d.js.map +0 -1
  100. package/dist/behavior/ricochet-3d.d.ts +0 -117
  101. package/dist/behavior/ricochet-3d.js +0 -443
  102. package/dist/behavior/ricochet-3d.js.map +0 -1
  103. package/dist/behavior/screen-visibility.d.ts +0 -79
  104. package/dist/behavior/screen-visibility.js +0 -358
  105. package/dist/behavior/screen-visibility.js.map +0 -1
  106. package/dist/behavior/screen-wrap.d.ts +0 -87
  107. package/dist/behavior/screen-wrap.js +0 -246
  108. package/dist/behavior/screen-wrap.js.map +0 -1
  109. package/dist/behavior/shooter-2d.d.ts +0 -79
  110. package/dist/behavior/shooter-2d.js +0 -180
  111. package/dist/behavior/shooter-2d.js.map +0 -1
  112. package/dist/behavior/thruster.d.ts +0 -11
  113. package/dist/behavior/thruster.js +0 -292
  114. package/dist/behavior/thruster.js.map +0 -1
  115. package/dist/behavior/top-down-movement.d.ts +0 -56
  116. package/dist/behavior/top-down-movement.js +0 -125
  117. package/dist/behavior/top-down-movement.js.map +0 -1
  118. package/dist/behavior/world-boundary-2d.d.ts +0 -142
  119. package/dist/behavior/world-boundary-2d.js +0 -235
  120. package/dist/behavior/world-boundary-2d.js.map +0 -1
  121. package/dist/behavior/world-boundary-3d.d.ts +0 -76
  122. package/dist/behavior/world-boundary-3d.js +0 -274
  123. package/dist/behavior/world-boundary-3d.js.map +0 -1
  124. package/dist/behavior-descriptor-BXnVR8Ki.d.ts +0 -159
  125. package/dist/blueprints-DmbK2dki.d.ts +0 -26
  126. package/dist/camera-4XO5gbQH.d.ts +0 -905
  127. package/dist/camera.d.ts +0 -6
  128. package/dist/camera.js +0 -1993
  129. package/dist/camera.js.map +0 -1
  130. package/dist/composition-BASvMKrW.d.ts +0 -218
  131. package/dist/core-CARRaS55.d.ts +0 -541
  132. package/dist/core.js.map +0 -1
  133. package/dist/entities-ChFirVL9.d.ts +0 -410
  134. package/dist/entities.d.ts +0 -9
  135. package/dist/entities.js +0 -4986
  136. package/dist/entities.js.map +0 -1
  137. package/dist/entity-types-DAu8sGJH.d.ts +0 -26
  138. package/dist/global-change-2JvMaz44.d.ts +0 -25
  139. package/dist/main.d.ts +0 -1353
  140. package/dist/main.js +0 -19525
  141. package/dist/main.js.map +0 -1
  142. package/dist/physics-pose-DCc4oE44.d.ts +0 -25
  143. package/dist/physics-protocol-BDD3P5W2.d.ts +0 -200
  144. package/dist/physics-worker.d.ts +0 -21
  145. package/dist/physics-worker.js +0 -306
  146. package/dist/physics-worker.js.map +0 -1
  147. package/dist/physics.d.ts +0 -205
  148. package/dist/physics.js +0 -577
  149. package/dist/physics.js.map +0 -1
  150. package/dist/stage-types-C19IhuzA.d.ts +0 -731
  151. package/dist/stage.d.ts +0 -52
  152. package/dist/stage.js +0 -8479
  153. package/dist/stage.js.map +0 -1
  154. package/dist/sync-state-machine-CZyspBpj.d.ts +0 -16
  155. package/dist/thruster-23lzoPZd.d.ts +0 -180
  156. package/dist/world-DfgxoNMt.d.ts +0 -105
@@ -0,0 +1,59 @@
1
+ import { StageBodyKindValue, StageBodyConfig, StageColliderConfig } from '@zylem/behaviors/core';
2
+ export { BehaviorRuntime, EntityDefinition, EntityHandle, Simulation, SimulationBodyDefinition, SimulationColliderDefinition, SimulationEvent, SimulationFrame, SimulationOptions, StageBodyConfig, StageBodyInfo, StageBodyKind, StageBodyKindValue, StageBoundaryDim, StageColliderConfig, StageColliderShape, StageDebugRender, StageEvent, StageEventType, StagePose, StageRaycastHit, StageRenderSlot, StageRicochetDim, StageRicochetReflection, StageTopDownPlane, createSimulation } from '@zylem/behaviors/core';
3
+ import { e as Vec3Input } from './vector-CiSHbivc.js';
4
+ export { l as SimulationBody, S as SimulationStepClock } from './vector-CiSHbivc.js';
5
+ export { p as packCollisionGroups } from './collision-builder-jF-toPIl.js';
6
+ import 'three';
7
+
8
+ /**
9
+ * Runtime-side collision builder. Emits plain `BodyConfig` + `ColliderConfig`
10
+ * shapes ready to be uploaded to the wasm `StageSimulation` via
11
+ * {@link WasmStageRuntime}. **No** Rapier types appear in this module — that's
12
+ * the entire point: `@zylem/game-lib` should not depend on
13
+ * `@dimforge/rapier3d-compat` once the migration is complete.
14
+ *
15
+ * The TS-side `CollisionBuilder` (in `collision-builder.ts`) is being phased
16
+ * out in favor of these helpers; mirror its public surface (cuboid /
17
+ * sphere / capsule / cylinder / convex hull / trimesh) so existing entity
18
+ * factories can swap their implementation 1:1.
19
+ */
20
+
21
+ /** Body-level options the host can override per entity. */
22
+ interface RuntimeBodyOptions {
23
+ kind?: StageBodyKindValue;
24
+ position?: Vec3Input;
25
+ rotation?: readonly [number, number, number, number];
26
+ linearDamping?: number;
27
+ angularDamping?: number;
28
+ gravityScale?: number;
29
+ canSleep?: boolean;
30
+ ccdEnabled?: boolean;
31
+ lockRotation?: readonly [boolean, boolean, boolean];
32
+ lockTranslation?: readonly [boolean, boolean, boolean];
33
+ }
34
+ /** Collider-level options forwarded as-is from the legacy `CollisionOptions`. */
35
+ interface RuntimeColliderOptions {
36
+ offset?: Vec3Input;
37
+ friction?: number;
38
+ restitution?: number;
39
+ sensor?: boolean;
40
+ collisionType?: string;
41
+ collisionFilter?: string[];
42
+ }
43
+ declare function buildRuntimeBody(options?: RuntimeBodyOptions): StageBodyConfig;
44
+ /** Cuboid collider sized as `size.xyz` (full extents — half-extents are computed). */
45
+ declare function buildBoxCollider(size: Vec3Input, options?: RuntimeColliderOptions): StageColliderConfig;
46
+ declare function buildSphereCollider(radius: number, options?: RuntimeColliderOptions): StageColliderConfig;
47
+ declare function buildCapsuleCollider(halfHeight: number, radius: number, options?: RuntimeColliderOptions): StageColliderConfig;
48
+ declare function buildCylinderCollider(halfHeight: number, radius: number, options?: RuntimeColliderOptions): StageColliderConfig;
49
+ declare function buildConvexHullCollider(vertices: Float32Array, options?: RuntimeColliderOptions): StageColliderConfig;
50
+ declare function buildTrimeshCollider(vertices: Float32Array, indices: Uint32Array, options?: RuntimeColliderOptions): StageColliderConfig;
51
+ declare function buildHeightfieldCollider(rows: number, cols: number, heights: Float32Array, scale: readonly [number, number, number], options?: RuntimeColliderOptions): StageColliderConfig;
52
+ /** Convenience: bundle a body + a list of colliders, the shape entity factories want. */
53
+ interface RuntimeCollisionBundle {
54
+ body: StageBodyConfig;
55
+ colliders: StageColliderConfig[];
56
+ }
57
+ declare function bundleRuntimeCollision(body: StageBodyConfig, colliders: StageColliderConfig[]): RuntimeCollisionBundle;
58
+
59
+ export { type RuntimeBodyOptions, type RuntimeColliderOptions, type RuntimeCollisionBundle, buildBoxCollider, buildCapsuleCollider, buildConvexHullCollider, buildCylinderCollider, buildHeightfieldCollider, buildRuntimeBody, buildSphereCollider, buildTrimeshCollider, bundleRuntimeCollision };
@@ -0,0 +1 @@
1
+ import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p,o as q,p as r}from"./chunk-IKWE2W6L.js";import{b}from"./chunk-G4HONLWC.js";import{a}from"./chunk-E3UBSUPX.js";import"./chunk-7WRQ2UAN.js";export{b as SimulationBody,l as StageBodyKind,m as StageBoundaryDim,n as StageEventType,o as StageRicochetDim,p as StageRicochetReflection,q as StageTopDownPlane,d as buildBoxCollider,f as buildCapsuleCollider,h as buildConvexHullCollider,g as buildCylinderCollider,j as buildHeightfieldCollider,c as buildRuntimeBody,e as buildSphereCollider,i as buildTrimeshCollider,k as bundleRuntimeCollision,r as createSimulation,a as packCollisionGroups};
@@ -0,0 +1,244 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "EntityJson",
4
+ "title": "EntityJson",
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "properties": {
9
+ "id": {
10
+ "type": "string"
11
+ },
12
+ "type": {
13
+ "const": "text",
14
+ "type": "string"
15
+ },
16
+ "position": {
17
+ "title": "Vector2",
18
+ "description": "A 2D position as [x, y].",
19
+ "type": "array",
20
+ "items": [
21
+ {
22
+ "type": "number"
23
+ },
24
+ {
25
+ "type": "number"
26
+ }
27
+ ],
28
+ "additionalItems": false,
29
+ "minItems": 2,
30
+ "maxItems": 2
31
+ },
32
+ "data": {
33
+ "title": "TextEntityData",
34
+ "additionalProperties": true,
35
+ "type": "object",
36
+ "properties": {
37
+ "value": {
38
+ "type": "string"
39
+ },
40
+ "color": {
41
+ "type": "string"
42
+ },
43
+ "fontSize": {
44
+ "type": "number"
45
+ },
46
+ "fontFamily": {
47
+ "type": "string"
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "required": [
53
+ "id",
54
+ "type"
55
+ ]
56
+ },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "id": {
61
+ "type": "string"
62
+ },
63
+ "type": {
64
+ "const": "sprite",
65
+ "type": "string"
66
+ },
67
+ "position": {
68
+ "title": "Vector2",
69
+ "description": "A 2D position as [x, y].",
70
+ "type": "array",
71
+ "items": [
72
+ {
73
+ "type": "number"
74
+ },
75
+ {
76
+ "type": "number"
77
+ }
78
+ ],
79
+ "additionalItems": false,
80
+ "minItems": 2,
81
+ "maxItems": 2
82
+ },
83
+ "data": {
84
+ "title": "SpriteEntityData",
85
+ "additionalProperties": true,
86
+ "type": "object",
87
+ "properties": {
88
+ "imagePath": {
89
+ "type": "string"
90
+ },
91
+ "width": {
92
+ "type": "number"
93
+ },
94
+ "height": {
95
+ "type": "number"
96
+ }
97
+ }
98
+ }
99
+ },
100
+ "required": [
101
+ "id",
102
+ "type"
103
+ ]
104
+ },
105
+ {
106
+ "type": "object",
107
+ "properties": {
108
+ "id": {
109
+ "type": "string"
110
+ },
111
+ "type": {
112
+ "const": "line",
113
+ "type": "string"
114
+ },
115
+ "position": {
116
+ "title": "Vector2",
117
+ "description": "A 2D position as [x, y].",
118
+ "type": "array",
119
+ "items": [
120
+ {
121
+ "type": "number"
122
+ },
123
+ {
124
+ "type": "number"
125
+ }
126
+ ],
127
+ "additionalItems": false,
128
+ "minItems": 2,
129
+ "maxItems": 2
130
+ },
131
+ "data": {
132
+ "title": "LineEntityData",
133
+ "additionalProperties": true,
134
+ "type": "object",
135
+ "properties": {
136
+ "points": {
137
+ "minItems": 2,
138
+ "type": "array",
139
+ "items": {
140
+ "title": "Vector3Tuple",
141
+ "type": "array",
142
+ "items": [
143
+ {
144
+ "type": "number"
145
+ },
146
+ {
147
+ "type": "number"
148
+ },
149
+ {
150
+ "type": "number"
151
+ }
152
+ ],
153
+ "additionalItems": false,
154
+ "minItems": 3,
155
+ "maxItems": 3
156
+ }
157
+ },
158
+ "color": {
159
+ "type": "string"
160
+ },
161
+ "colors": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "linewidth": {
168
+ "type": "number"
169
+ },
170
+ "worldUnits": {
171
+ "type": "boolean"
172
+ },
173
+ "alphaToCoverage": {
174
+ "type": "boolean"
175
+ },
176
+ "opacity": {
177
+ "type": "number"
178
+ },
179
+ "transparent": {
180
+ "type": "boolean"
181
+ },
182
+ "dashed": {
183
+ "type": "boolean"
184
+ },
185
+ "dashSize": {
186
+ "type": "number"
187
+ },
188
+ "gapSize": {
189
+ "type": "number"
190
+ },
191
+ "pickThreshold": {
192
+ "type": "number"
193
+ }
194
+ },
195
+ "required": [
196
+ "points"
197
+ ]
198
+ }
199
+ },
200
+ "required": [
201
+ "id",
202
+ "type"
203
+ ]
204
+ },
205
+ {
206
+ "type": "object",
207
+ "properties": {
208
+ "id": {
209
+ "type": "string"
210
+ },
211
+ "type": {
212
+ "minLength": 1,
213
+ "type": "string"
214
+ },
215
+ "position": {
216
+ "title": "Vector2",
217
+ "description": "A 2D position as [x, y].",
218
+ "type": "array",
219
+ "items": [
220
+ {
221
+ "type": "number"
222
+ },
223
+ {
224
+ "type": "number"
225
+ }
226
+ ],
227
+ "additionalItems": false,
228
+ "minItems": 2,
229
+ "maxItems": 2
230
+ },
231
+ "data": {
232
+ "type": "object",
233
+ "patternProperties": {
234
+ "^(.*)$": {}
235
+ }
236
+ }
237
+ },
238
+ "required": [
239
+ "id",
240
+ "type"
241
+ ]
242
+ }
243
+ ]
244
+ }