ball2d 0.1.1 → 0.2.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/LICENSE +42 -0
- package/README.md +193 -138
- package/dist/browser.js +1737 -1206
- package/dist/core.wasm +0 -0
- package/dist/node.js +104 -43358
- package/dist/stadiums/big.hbs +515 -85
- package/dist/stadiums/big_easy.hbs +515 -85
- package/dist/stadiums/big_hockey.hbs +612 -87
- package/dist/stadiums/big_rounded.hbs +611 -100
- package/dist/stadiums/classic.hbs +515 -85
- package/dist/stadiums/easy.hbs +515 -85
- package/dist/stadiums/hockey.hbs +612 -87
- package/dist/stadiums/huge.hbs +515 -85
- package/dist/stadiums/provenance.json +24 -22
- package/dist/stadiums/rounded.hbs +611 -100
- package/dist/stadiums/small.hbs +515 -85
- package/dist/types/announcement.d.ts +1 -0
- package/dist/types/browser.d.ts +10 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/disc.d.ts +4 -0
- package/dist/types/{core/match-state.d.ts → match-state.d.ts} +2 -0
- package/dist/types/node.d.ts +15 -0
- package/dist/types/{core/host-types.d.ts → player.d.ts} +3 -1
- package/dist/types/{core/replay-types.d.ts → replay.d.ts} +3 -3
- package/dist/types/{sdk/types.d.ts → room.d.ts} +9 -4
- package/dist/types/stadium.d.ts +5 -0
- package/dist/types/team.d.ts +6 -0
- package/package.json +28 -6
- package/dist/types/client/announcement.d.ts +0 -10
- package/dist/types/client/connection-stats.d.ts +0 -11
- package/dist/types/client/headless.d.ts +0 -130
- package/dist/types/client/host-config.d.ts +0 -11
- package/dist/types/client/host-runtime.d.ts +0 -10
- package/dist/types/client/network-runtime.d.ts +0 -8
- package/dist/types/client/network.d.ts +0 -91
- package/dist/types/client/stadium-library.d.ts +0 -4
- package/dist/types/client/startup-scope.d.ts +0 -6
- package/dist/types/client/traffic.d.ts +0 -9
- package/dist/types/core/avatar.d.ts +0 -2
- package/dist/types/core/build-id.d.ts +0 -2
- package/dist/types/core/control.d.ts +0 -5
- package/dist/types/core/disc-properties.d.ts +0 -7
- package/dist/types/core/engine.d.ts +0 -68
- package/dist/types/core/protocol.d.ts +0 -24
- package/dist/types/core/replay-codec.d.ts +0 -6
- package/dist/types/core/replay-wire.d.ts +0 -5
- package/dist/types/core/replay.d.ts +0 -48
- package/dist/types/core/stadium.d.ts +0 -91
- package/dist/types/core/team-colors.d.ts +0 -8
- package/dist/types/sdk/browser.d.ts +0 -11
- package/dist/types/sdk/command-queue.d.ts +0 -11
- package/dist/types/sdk/config.d.ts +0 -6
- package/dist/types/sdk/node-transport.d.ts +0 -4
- package/dist/types/sdk/node.d.ts +0 -18
- package/dist/types/sdk/replay.d.ts +0 -4
- package/dist/types/sdk/room.d.ts +0 -7
- package/dist/types/sdk/stadium.d.ts +0 -9
- package/dist/types/shared/room-link.d.ts +0 -6
- /package/dist/types/{sdk/create-options.d.ts → creation.d.ts} +0 -0
package/dist/stadiums/small.hbs
CHANGED
|
@@ -1,85 +1,515 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"physicsMode": "substeps",
|
|
4
|
+
"name": "Small",
|
|
5
|
+
"width": 395,
|
|
6
|
+
"height": 225,
|
|
7
|
+
"spawnDistance": 128,
|
|
8
|
+
"bg": {
|
|
9
|
+
"type": "grass",
|
|
10
|
+
"width": 320,
|
|
11
|
+
"height": 160,
|
|
12
|
+
"kickOffRadius": 65,
|
|
13
|
+
"color": "285B35",
|
|
14
|
+
"cornerRadius": 0
|
|
15
|
+
},
|
|
16
|
+
"vertexes": [
|
|
17
|
+
{
|
|
18
|
+
"x": -320,
|
|
19
|
+
"y": -160,
|
|
20
|
+
"cMask": [
|
|
21
|
+
"ball"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"x": 320,
|
|
26
|
+
"y": -160,
|
|
27
|
+
"cMask": [
|
|
28
|
+
"ball"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"x": 320,
|
|
33
|
+
"y": -160,
|
|
34
|
+
"cMask": [
|
|
35
|
+
"ball"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"x": 320,
|
|
40
|
+
"y": -60,
|
|
41
|
+
"cMask": [
|
|
42
|
+
"ball"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"x": 320,
|
|
47
|
+
"y": 60,
|
|
48
|
+
"cMask": [
|
|
49
|
+
"ball"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"x": 320,
|
|
54
|
+
"y": 160,
|
|
55
|
+
"cMask": [
|
|
56
|
+
"ball"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"x": 320,
|
|
61
|
+
"y": 160,
|
|
62
|
+
"cMask": [
|
|
63
|
+
"ball"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"x": -320,
|
|
68
|
+
"y": 160,
|
|
69
|
+
"cMask": [
|
|
70
|
+
"ball"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"x": -320,
|
|
75
|
+
"y": 160,
|
|
76
|
+
"cMask": [
|
|
77
|
+
"ball"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"x": -320,
|
|
82
|
+
"y": 60,
|
|
83
|
+
"cMask": [
|
|
84
|
+
"ball"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"x": -320,
|
|
89
|
+
"y": -60,
|
|
90
|
+
"cMask": [
|
|
91
|
+
"ball"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"x": -320,
|
|
96
|
+
"y": -160,
|
|
97
|
+
"cMask": [
|
|
98
|
+
"ball"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"x": -320,
|
|
103
|
+
"y": -60,
|
|
104
|
+
"cMask": [
|
|
105
|
+
"ball"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"x": -350,
|
|
110
|
+
"y": -60,
|
|
111
|
+
"cMask": [
|
|
112
|
+
"ball"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"x": -350,
|
|
117
|
+
"y": -60,
|
|
118
|
+
"cMask": [
|
|
119
|
+
"ball"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"x": -350,
|
|
124
|
+
"y": 60,
|
|
125
|
+
"cMask": [
|
|
126
|
+
"ball"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"x": -350,
|
|
131
|
+
"y": 60,
|
|
132
|
+
"cMask": [
|
|
133
|
+
"ball"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"x": -320,
|
|
138
|
+
"y": 60,
|
|
139
|
+
"cMask": [
|
|
140
|
+
"ball"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"x": 320,
|
|
145
|
+
"y": -60,
|
|
146
|
+
"cMask": [
|
|
147
|
+
"ball"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"x": 350,
|
|
152
|
+
"y": -60,
|
|
153
|
+
"cMask": [
|
|
154
|
+
"ball"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"x": 350,
|
|
159
|
+
"y": -60,
|
|
160
|
+
"cMask": [
|
|
161
|
+
"ball"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"x": 350,
|
|
166
|
+
"y": 60,
|
|
167
|
+
"cMask": [
|
|
168
|
+
"ball"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"x": 350,
|
|
173
|
+
"y": 60,
|
|
174
|
+
"cMask": [
|
|
175
|
+
"ball"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"x": 320,
|
|
180
|
+
"y": 60,
|
|
181
|
+
"cMask": [
|
|
182
|
+
"ball"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"x": 0,
|
|
187
|
+
"y": -200,
|
|
188
|
+
"cGroup": [
|
|
189
|
+
"redKO",
|
|
190
|
+
"blueKO"
|
|
191
|
+
],
|
|
192
|
+
"cMask": [
|
|
193
|
+
"red",
|
|
194
|
+
"blue"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"x": 0,
|
|
199
|
+
"y": -65,
|
|
200
|
+
"cGroup": [
|
|
201
|
+
"redKO",
|
|
202
|
+
"blueKO"
|
|
203
|
+
],
|
|
204
|
+
"cMask": [
|
|
205
|
+
"red",
|
|
206
|
+
"blue"
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"x": 0,
|
|
211
|
+
"y": 65,
|
|
212
|
+
"cGroup": [
|
|
213
|
+
"redKO",
|
|
214
|
+
"blueKO"
|
|
215
|
+
],
|
|
216
|
+
"cMask": [
|
|
217
|
+
"red",
|
|
218
|
+
"blue"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"x": 0,
|
|
223
|
+
"y": 200,
|
|
224
|
+
"cGroup": [
|
|
225
|
+
"redKO",
|
|
226
|
+
"blueKO"
|
|
227
|
+
],
|
|
228
|
+
"cMask": [
|
|
229
|
+
"red",
|
|
230
|
+
"blue"
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
"segments": [
|
|
235
|
+
{
|
|
236
|
+
"v0": 0,
|
|
237
|
+
"v1": 1,
|
|
238
|
+
"curve": 0,
|
|
239
|
+
"cMask": [
|
|
240
|
+
"ball"
|
|
241
|
+
],
|
|
242
|
+
"color": "72A99C",
|
|
243
|
+
"bCoef": 0.8
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"v0": 2,
|
|
247
|
+
"v1": 3,
|
|
248
|
+
"curve": 0,
|
|
249
|
+
"cMask": [
|
|
250
|
+
"ball"
|
|
251
|
+
],
|
|
252
|
+
"color": "72A99C",
|
|
253
|
+
"bCoef": 0.8
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"v0": 4,
|
|
257
|
+
"v1": 5,
|
|
258
|
+
"curve": 0,
|
|
259
|
+
"cMask": [
|
|
260
|
+
"ball"
|
|
261
|
+
],
|
|
262
|
+
"color": "72A99C",
|
|
263
|
+
"bCoef": 0.8
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"v0": 6,
|
|
267
|
+
"v1": 7,
|
|
268
|
+
"curve": 0,
|
|
269
|
+
"cMask": [
|
|
270
|
+
"ball"
|
|
271
|
+
],
|
|
272
|
+
"color": "72A99C",
|
|
273
|
+
"bCoef": 0.8
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"v0": 8,
|
|
277
|
+
"v1": 9,
|
|
278
|
+
"curve": 0,
|
|
279
|
+
"cMask": [
|
|
280
|
+
"ball"
|
|
281
|
+
],
|
|
282
|
+
"color": "72A99C",
|
|
283
|
+
"bCoef": 0.8
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"v0": 10,
|
|
287
|
+
"v1": 11,
|
|
288
|
+
"curve": 0,
|
|
289
|
+
"cMask": [
|
|
290
|
+
"ball"
|
|
291
|
+
],
|
|
292
|
+
"color": "72A99C",
|
|
293
|
+
"bCoef": 0.8
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"v0": 12,
|
|
297
|
+
"v1": 13,
|
|
298
|
+
"curve": 0,
|
|
299
|
+
"cMask": [
|
|
300
|
+
"ball"
|
|
301
|
+
],
|
|
302
|
+
"color": "3D7267",
|
|
303
|
+
"bCoef": 0.15
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"v0": 14,
|
|
307
|
+
"v1": 15,
|
|
308
|
+
"curve": 0,
|
|
309
|
+
"cMask": [
|
|
310
|
+
"ball"
|
|
311
|
+
],
|
|
312
|
+
"color": "3D7267",
|
|
313
|
+
"bCoef": 0.15
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"v0": 16,
|
|
317
|
+
"v1": 17,
|
|
318
|
+
"curve": 0,
|
|
319
|
+
"cMask": [
|
|
320
|
+
"ball"
|
|
321
|
+
],
|
|
322
|
+
"color": "3D7267",
|
|
323
|
+
"bCoef": 0.15
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"v0": 18,
|
|
327
|
+
"v1": 19,
|
|
328
|
+
"curve": 0,
|
|
329
|
+
"cMask": [
|
|
330
|
+
"ball"
|
|
331
|
+
],
|
|
332
|
+
"color": "3D7267",
|
|
333
|
+
"bCoef": 0.15
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"v0": 20,
|
|
337
|
+
"v1": 21,
|
|
338
|
+
"curve": 0,
|
|
339
|
+
"cMask": [
|
|
340
|
+
"ball"
|
|
341
|
+
],
|
|
342
|
+
"color": "3D7267",
|
|
343
|
+
"bCoef": 0.15
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"v0": 22,
|
|
347
|
+
"v1": 23,
|
|
348
|
+
"curve": 0,
|
|
349
|
+
"cMask": [
|
|
350
|
+
"ball"
|
|
351
|
+
],
|
|
352
|
+
"color": "3D7267",
|
|
353
|
+
"bCoef": 0.15
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"v0": 24,
|
|
357
|
+
"v1": 25,
|
|
358
|
+
"vis": false,
|
|
359
|
+
"cGroup": [
|
|
360
|
+
"redKO",
|
|
361
|
+
"blueKO"
|
|
362
|
+
],
|
|
363
|
+
"cMask": [
|
|
364
|
+
"red",
|
|
365
|
+
"blue"
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"v0": 26,
|
|
370
|
+
"v1": 27,
|
|
371
|
+
"vis": false,
|
|
372
|
+
"cGroup": [
|
|
373
|
+
"redKO",
|
|
374
|
+
"blueKO"
|
|
375
|
+
],
|
|
376
|
+
"cMask": [
|
|
377
|
+
"red",
|
|
378
|
+
"blue"
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"v0": 26,
|
|
383
|
+
"v1": 25,
|
|
384
|
+
"curve": -180,
|
|
385
|
+
"vis": false,
|
|
386
|
+
"cGroup": [
|
|
387
|
+
"redKO"
|
|
388
|
+
],
|
|
389
|
+
"cMask": [
|
|
390
|
+
"red",
|
|
391
|
+
"blue"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"v0": 26,
|
|
396
|
+
"v1": 25,
|
|
397
|
+
"curve": 180,
|
|
398
|
+
"vis": false,
|
|
399
|
+
"cGroup": [
|
|
400
|
+
"blueKO"
|
|
401
|
+
],
|
|
402
|
+
"cMask": [
|
|
403
|
+
"red",
|
|
404
|
+
"blue"
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"planes": [
|
|
409
|
+
{
|
|
410
|
+
"normal": [
|
|
411
|
+
0,
|
|
412
|
+
1
|
|
413
|
+
],
|
|
414
|
+
"dist": -200
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
"normal": [
|
|
418
|
+
0,
|
|
419
|
+
-1
|
|
420
|
+
],
|
|
421
|
+
"dist": -200
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"normal": [
|
|
425
|
+
1,
|
|
426
|
+
0
|
|
427
|
+
],
|
|
428
|
+
"dist": -370
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"normal": [
|
|
432
|
+
-1,
|
|
433
|
+
0
|
|
434
|
+
],
|
|
435
|
+
"dist": -370
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
"goals": [
|
|
439
|
+
{
|
|
440
|
+
"p0": [
|
|
441
|
+
-320,
|
|
442
|
+
-60
|
|
443
|
+
],
|
|
444
|
+
"p1": [
|
|
445
|
+
-320,
|
|
446
|
+
60
|
|
447
|
+
],
|
|
448
|
+
"team": "red"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"p0": [
|
|
452
|
+
320,
|
|
453
|
+
-60
|
|
454
|
+
],
|
|
455
|
+
"p1": [
|
|
456
|
+
320,
|
|
457
|
+
60
|
|
458
|
+
],
|
|
459
|
+
"team": "blue"
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
"discs": [
|
|
463
|
+
{
|
|
464
|
+
"pos": [
|
|
465
|
+
-320,
|
|
466
|
+
-60
|
|
467
|
+
],
|
|
468
|
+
"radius": 6,
|
|
469
|
+
"invMass": 0,
|
|
470
|
+
"color": "DAEEE4",
|
|
471
|
+
"bCoef": 0.5
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"pos": [
|
|
475
|
+
-320,
|
|
476
|
+
60
|
|
477
|
+
],
|
|
478
|
+
"radius": 6,
|
|
479
|
+
"invMass": 0,
|
|
480
|
+
"color": "DAEEE4",
|
|
481
|
+
"bCoef": 0.5
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
"pos": [
|
|
485
|
+
320,
|
|
486
|
+
-60
|
|
487
|
+
],
|
|
488
|
+
"radius": 6,
|
|
489
|
+
"invMass": 0,
|
|
490
|
+
"color": "DAEEE4",
|
|
491
|
+
"bCoef": 0.5
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"pos": [
|
|
495
|
+
320,
|
|
496
|
+
60
|
|
497
|
+
],
|
|
498
|
+
"radius": 6,
|
|
499
|
+
"invMass": 0,
|
|
500
|
+
"color": "DAEEE4",
|
|
501
|
+
"bCoef": 0.5
|
|
502
|
+
}
|
|
503
|
+
],
|
|
504
|
+
"ballPhysics": {
|
|
505
|
+
"radius": 9,
|
|
506
|
+
"damping": 0.991,
|
|
507
|
+
"bCoef": 0.6
|
|
508
|
+
},
|
|
509
|
+
"playerPhysics": {
|
|
510
|
+
"radius": 15,
|
|
511
|
+
"acceleration": 0.11,
|
|
512
|
+
"damping": 0.96,
|
|
513
|
+
"kickStrength": 5.5
|
|
514
|
+
}
|
|
515
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AnnouncementStyle = 'normal' | 'bold' | 'italic' | 'small' | 'small-bold' | 'small-italic';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RoomConfig } from './config.js';
|
|
2
|
+
import type { CreateRoomOptions } from './creation.js';
|
|
3
|
+
import type { Room } from './room.js';
|
|
4
|
+
import type { Replay } from './replay.js';
|
|
5
|
+
import type { StadiumValidation } from './stadium.js';
|
|
6
|
+
export type { RoomConfig, CreateRoomOptions, Room, Replay, StadiumValidation };
|
|
7
|
+
export type { HostPlayer, HostScores, HostDiscProperties } from './player.js';
|
|
8
|
+
export declare function createRoom(config?: RoomConfig, options?: CreateRoomOptions): Promise<Room>;
|
|
9
|
+
export declare function readReplay(blob: Blob): Promise<Replay>;
|
|
10
|
+
export declare function validateStadium(source: string): StadiumValidation;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Supported public disc properties; no internal solver offsets or validation tables. */
|
|
2
|
+
export type DiscProperty = 'x' | 'y' | 'xspeed' | 'yspeed' | 'xgravity' | 'ygravity' | 'radius' | 'bCoeff' | 'invMass' | 'damping' | 'color' | 'cMask' | 'cGroup';
|
|
3
|
+
export type DiscProperties = Record<DiscProperty, number>;
|
|
4
|
+
export type DiscPropertyPatch = Partial<Record<DiscProperty, number | null>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RoomConfig } from './config.js';
|
|
2
|
+
import type { Room } from './room.js';
|
|
3
|
+
import type { CreateRoomOptions } from './creation.js';
|
|
4
|
+
export { readReplay, validateStadium } from './browser.js';
|
|
5
|
+
export type { Replay, StadiumValidation, CreateRoomOptions, HostPlayer, HostScores, HostDiscProperties, } from './browser.js';
|
|
6
|
+
export interface NodeRoomConfig extends RoomConfig {
|
|
7
|
+
/** Ball2D signaling service. Defaults to https://ball2d.com. */
|
|
8
|
+
serviceOrigin?: string;
|
|
9
|
+
/** Required account-owned API key. Keep it on your server, never in browser code. */
|
|
10
|
+
apiKey: string;
|
|
11
|
+
}
|
|
12
|
+
export type NodeRoom = Room & {
|
|
13
|
+
readonly closed: Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
export declare function createRoom(config: NodeRoomConfig, creation?: CreateRoomOptions): Promise<NodeRoom>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { DiscProperties } from './disc
|
|
1
|
+
import type { DiscProperties } from './disc.js';
|
|
2
2
|
export interface HostPlayer {
|
|
3
3
|
id: number;
|
|
4
4
|
peerId: string;
|
|
5
5
|
name: string;
|
|
6
6
|
team: 0 | 1 | 2;
|
|
7
7
|
admin: boolean;
|
|
8
|
+
/** Room chat is suppressed while true; absent on older hosts. */
|
|
9
|
+
muted?: boolean;
|
|
8
10
|
avatar?: string | null;
|
|
9
11
|
position: {
|
|
10
12
|
x: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { DiscPropertyPatch } from './disc
|
|
2
|
-
import type { TeamStyles } from './team
|
|
1
|
+
import type { DiscPropertyPatch } from './disc.js';
|
|
2
|
+
import type { TeamStyles } from './team.js';
|
|
3
3
|
import type { MatchState } from './match-state.js';
|
|
4
4
|
export type ReplayCommand = {
|
|
5
5
|
tick: number;
|
|
6
|
-
kind: 'input' | 'team' | 'start' | 'stop' | 'pause' | 'scoreLimit' | 'timeLimit' | 'kickRate' | 'join' | 'disc';
|
|
6
|
+
kind: 'input' | 'team' | 'start' | 'stop' | 'pause' | 'scoreLimit' | 'timeLimit' | 'kickRate' | 'join' | 'disc' | 'surface';
|
|
7
7
|
properties?: DiscPropertyPatch;
|
|
8
8
|
slot: number;
|
|
9
9
|
value: number;
|