ball2d 0.1.0 → 0.2.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 (59) hide show
  1. package/LICENSE +42 -0
  2. package/README.md +184 -139
  3. package/dist/browser.js +1791 -1252
  4. package/dist/core.wasm +0 -0
  5. package/dist/node.js +104 -43358
  6. package/dist/stadiums/big.hbs +515 -85
  7. package/dist/stadiums/big_easy.hbs +515 -85
  8. package/dist/stadiums/big_hockey.hbs +612 -87
  9. package/dist/stadiums/big_rounded.hbs +611 -100
  10. package/dist/stadiums/classic.hbs +515 -85
  11. package/dist/stadiums/easy.hbs +515 -85
  12. package/dist/stadiums/hockey.hbs +612 -87
  13. package/dist/stadiums/huge.hbs +515 -85
  14. package/dist/stadiums/provenance.json +24 -22
  15. package/dist/stadiums/rounded.hbs +611 -100
  16. package/dist/stadiums/small.hbs +515 -85
  17. package/dist/types/announcement.d.ts +1 -0
  18. package/dist/types/browser.d.ts +10 -0
  19. package/dist/types/config.d.ts +9 -0
  20. package/dist/types/disc.d.ts +4 -0
  21. package/dist/types/{core/match-state.d.ts → match-state.d.ts} +2 -0
  22. package/dist/types/node.d.ts +15 -0
  23. package/dist/types/{core/host-types.d.ts → player.d.ts} +1 -1
  24. package/dist/types/{core/replay-types.d.ts → replay.d.ts} +3 -3
  25. package/dist/types/{sdk/types.d.ts → room.d.ts} +6 -4
  26. package/dist/types/stadium.d.ts +5 -0
  27. package/dist/types/team.d.ts +6 -0
  28. package/package.json +32 -8
  29. package/dist/types/client/announcement.d.ts +0 -10
  30. package/dist/types/client/connection-stats.d.ts +0 -11
  31. package/dist/types/client/headless.d.ts +0 -130
  32. package/dist/types/client/host-config.d.ts +0 -11
  33. package/dist/types/client/host-runtime.d.ts +0 -10
  34. package/dist/types/client/network-runtime.d.ts +0 -8
  35. package/dist/types/client/network.d.ts +0 -91
  36. package/dist/types/client/stadium-library.d.ts +0 -4
  37. package/dist/types/client/startup-scope.d.ts +0 -6
  38. package/dist/types/client/traffic.d.ts +0 -9
  39. package/dist/types/core/avatar.d.ts +0 -2
  40. package/dist/types/core/build-id.d.ts +0 -2
  41. package/dist/types/core/control.d.ts +0 -5
  42. package/dist/types/core/disc-properties.d.ts +0 -7
  43. package/dist/types/core/engine.d.ts +0 -68
  44. package/dist/types/core/protocol.d.ts +0 -24
  45. package/dist/types/core/replay-codec.d.ts +0 -6
  46. package/dist/types/core/replay-wire.d.ts +0 -5
  47. package/dist/types/core/replay.d.ts +0 -48
  48. package/dist/types/core/stadium.d.ts +0 -91
  49. package/dist/types/core/team-colors.d.ts +0 -8
  50. package/dist/types/sdk/browser.d.ts +0 -11
  51. package/dist/types/sdk/command-queue.d.ts +0 -11
  52. package/dist/types/sdk/config.d.ts +0 -6
  53. package/dist/types/sdk/node-transport.d.ts +0 -4
  54. package/dist/types/sdk/node.d.ts +0 -18
  55. package/dist/types/sdk/replay.d.ts +0 -4
  56. package/dist/types/sdk/room.d.ts +0 -7
  57. package/dist/types/sdk/stadium.d.ts +0 -9
  58. package/dist/types/shared/room-link.d.ts +0 -6
  59. /package/dist/types/{sdk/create-options.d.ts → creation.d.ts} +0 -0
@@ -1,100 +1,611 @@
1
- {
2
- "name" : "Big Rounded",
3
-
4
- "width" : 600,
5
- "height" : 270,
6
-
7
- "spawnDistance" : 350,
8
-
9
- "bg" : { "type" : "grass", "width" : 550, "height" : 240, "kickOffRadius" : 80, "cornerRadius" : 100 },
10
-
11
- "vertexes" : [
12
- { "x" : -550, "y" : 240, "trait" : "ballArea" },
13
- { "x" : -550, "y" : 80, "trait" : "ballArea" },
14
- { "x" : -550, "y" : -80, "trait" : "ballArea" },
15
- { "x" : -550, "y" : -240, "trait" : "ballArea" },
16
-
17
- { "x" : 550, "y" : 240, "trait" : "ballArea" },
18
- { "x" : 550, "y" : 80, "trait" : "ballArea" },
19
- { "x" : 550, "y" : -80, "trait" : "ballArea" },
20
- { "x" : 550, "y" : -240, "trait" : "ballArea" },
21
-
22
- { "x" : 0, "y" : 270, "trait" : "kickOffBarrier" },
23
- { "x" : 0, "y" : 80, "trait" : "kickOffBarrier" },
24
- { "x" : 0, "y" : -80, "trait" : "kickOffBarrier" },
25
- { "x" : 0, "y" : -270, "trait" : "kickOffBarrier" },
26
-
27
- { "x" : -560, "y" : -80, "trait" : "goalNet" },
28
- { "x" : -580, "y" : -60, "trait" : "goalNet" },
29
- { "x" : -580, "y" : 60, "trait" : "goalNet" },
30
- { "x" : -560, "y" : 80, "trait" : "goalNet" },
31
-
32
- { "x" : 560, "y" : -80, "trait" : "goalNet" },
33
- { "x" : 580, "y" : -60, "trait" : "goalNet" },
34
- { "x" : 580, "y" : 60, "trait" : "goalNet" },
35
- { "x" : 560, "y" : 80, "trait" : "goalNet" },
36
-
37
- { "x" : -450, "y" : -240, "trait" : "ballArea" },
38
- { "x" : -550, "y" : -140, "trait" : "ballArea" },
39
- { "x" : -550, "y" : 140, "trait" : "ballArea" },
40
- { "x" : -450, "y" : 240, "trait" : "ballArea" },
41
-
42
- { "x" : 450, "y" : -240, "trait" : "ballArea" },
43
- { "x" : 550, "y" : -140, "trait" : "ballArea" },
44
- { "x" : 550, "y" : 140, "trait" : "ballArea" },
45
- { "x" : 450, "y" : 240, "trait" : "ballArea" }
46
- ],
47
-
48
- "segments" : [
49
- { "v0" : 0, "v1" : 1, "trait" : "ballArea" },
50
- { "v0" : 2, "v1" : 3, "trait" : "ballArea" },
51
- { "v0" : 4, "v1" : 5, "trait" : "ballArea" },
52
- { "v0" : 6, "v1" : 7, "trait" : "ballArea" },
53
-
54
- { "v0" : 12, "v1" : 13, "trait" : "goalNet", "curve" : -90 },
55
- { "v0" : 13, "v1" : 14, "trait" : "goalNet" },
56
- { "v0" : 14, "v1" : 15, "trait" : "goalNet", "curve" : -90 },
57
-
58
- { "v0" : 16, "v1" : 17, "trait" : "goalNet", "curve" : 90 },
59
- { "v0" : 17, "v1" : 18, "trait" : "goalNet" },
60
- { "v0" : 18, "v1" : 19, "trait" : "goalNet", "curve" : 90 },
61
-
62
- { "v0" : 8, "v1" : 9, "trait" : "kickOffBarrier" },
63
- { "v0" : 9, "v1" : 10, "trait" : "kickOffBarrier", "curve" : 180, "cGroup" : ["blueKO"] },
64
- { "v0" : 9, "v1" : 10, "trait" : "kickOffBarrier", "curve" : -180, "cGroup" : ["redKO"] },
65
- { "v0" : 10, "v1" : 11, "trait" : "kickOffBarrier" },
66
-
67
- { "v0" : 20, "v1" : 21, "trait" : "ballArea", "curve" : -90 },
68
- { "v0" : 22, "v1" : 23, "trait" : "ballArea", "curve" : -90 },
69
- { "v0" : 24, "v1" : 25, "trait" : "ballArea", "curve" : 90 },
70
- { "v0" : 26, "v1" : 27, "trait" : "ballArea", "curve" : 90 }
71
- ],
72
-
73
- "goals" : [
74
- { "p0" : [-550, 80], "p1" : [-550,-80], "team" : "red" },
75
- { "p0" : [550, 80], "p1" : [550,-80], "team" : "blue" }
76
- ],
77
-
78
- "discs" : [
79
- { "pos" : [-550, 80], "trait" : "goalPost", "color" : "FFCCCC" },
80
- { "pos" : [-550, -80], "trait" : "goalPost", "color" : "FFCCCC" },
81
- { "pos" : [ 550, 80], "trait" : "goalPost", "color" : "CCCCFF" },
82
- { "pos" : [ 550, -80], "trait" : "goalPost", "color" : "CCCCFF" }
83
- ],
84
-
85
- "planes" : [
86
- { "normal" : [0, 1], "dist" : -240, "trait" : "ballArea" },
87
- { "normal" : [0,-1], "dist" : -240, "trait" : "ballArea" },
88
- { "normal" : [ 0, 1], "dist" : -270, "bCoef" : 0.1 },
89
- { "normal" : [ 0,-1], "dist" : -270, "bCoef" : 0.1 },
90
- { "normal" : [ 1, 0], "dist" : -600, "bCoef" : 0.1 },
91
- { "normal" : [-1, 0], "dist" : -600, "bCoef" : 0.1 }
92
- ],
93
-
94
- "traits" : {
95
- "ballArea" : { "vis" : false, "bCoef" : 1, "cMask" : ["ball"] },
96
- "goalPost" : { "radius" : 8, "invMass" : 0, "bCoef" : 0.5 },
97
- "goalNet" : { "vis" : true, "bCoef" : 0.1, "cMask" : ["ball"] },
98
- "kickOffBarrier" : { "vis" : false, "bCoef" : 0.1, "cGroup" : ["redKO", "blueKO"], "cMask" : ["red", "blue"] }
99
- }
100
- }
1
+ {
2
+ "version": 1,
3
+ "physicsMode": "substeps",
4
+ "name": "Big Rounded",
5
+ "width": 615,
6
+ "height": 325,
7
+ "spawnDistance": 216,
8
+ "bg": {
9
+ "type": "grass",
10
+ "width": 540,
11
+ "height": 260,
12
+ "kickOffRadius": 65,
13
+ "color": "285B35",
14
+ "cornerRadius": 48
15
+ },
16
+ "vertexes": [
17
+ {
18
+ "x": -492,
19
+ "y": -260,
20
+ "cMask": [
21
+ "ball"
22
+ ]
23
+ },
24
+ {
25
+ "x": 492,
26
+ "y": -260,
27
+ "cMask": [
28
+ "ball"
29
+ ]
30
+ },
31
+ {
32
+ "x": 540,
33
+ "y": -212,
34
+ "cMask": [
35
+ "ball"
36
+ ]
37
+ },
38
+ {
39
+ "x": 540,
40
+ "y": -70,
41
+ "cMask": [
42
+ "ball"
43
+ ]
44
+ },
45
+ {
46
+ "x": 540,
47
+ "y": 70,
48
+ "cMask": [
49
+ "ball"
50
+ ]
51
+ },
52
+ {
53
+ "x": 540,
54
+ "y": 212,
55
+ "cMask": [
56
+ "ball"
57
+ ]
58
+ },
59
+ {
60
+ "x": 492,
61
+ "y": 260,
62
+ "cMask": [
63
+ "ball"
64
+ ]
65
+ },
66
+ {
67
+ "x": -492,
68
+ "y": 260,
69
+ "cMask": [
70
+ "ball"
71
+ ]
72
+ },
73
+ {
74
+ "x": -540,
75
+ "y": 212,
76
+ "cMask": [
77
+ "ball"
78
+ ]
79
+ },
80
+ {
81
+ "x": -540,
82
+ "y": 70,
83
+ "cMask": [
84
+ "ball"
85
+ ]
86
+ },
87
+ {
88
+ "x": -540,
89
+ "y": -70,
90
+ "cMask": [
91
+ "ball"
92
+ ]
93
+ },
94
+ {
95
+ "x": -540,
96
+ "y": -212,
97
+ "cMask": [
98
+ "ball"
99
+ ]
100
+ },
101
+ {
102
+ "x": 492,
103
+ "y": -260,
104
+ "cMask": [
105
+ "ball"
106
+ ]
107
+ },
108
+ {
109
+ "x": 540,
110
+ "y": -212,
111
+ "cMask": [
112
+ "ball"
113
+ ]
114
+ },
115
+ {
116
+ "x": 540,
117
+ "y": 212,
118
+ "cMask": [
119
+ "ball"
120
+ ]
121
+ },
122
+ {
123
+ "x": 492,
124
+ "y": 260,
125
+ "cMask": [
126
+ "ball"
127
+ ]
128
+ },
129
+ {
130
+ "x": -492,
131
+ "y": 260,
132
+ "cMask": [
133
+ "ball"
134
+ ]
135
+ },
136
+ {
137
+ "x": -540,
138
+ "y": 212,
139
+ "cMask": [
140
+ "ball"
141
+ ]
142
+ },
143
+ {
144
+ "x": -540,
145
+ "y": -212,
146
+ "cMask": [
147
+ "ball"
148
+ ]
149
+ },
150
+ {
151
+ "x": -492,
152
+ "y": -260,
153
+ "cMask": [
154
+ "ball"
155
+ ]
156
+ },
157
+ {
158
+ "x": -540,
159
+ "y": -70,
160
+ "cMask": [
161
+ "ball"
162
+ ]
163
+ },
164
+ {
165
+ "x": -570,
166
+ "y": -70,
167
+ "cMask": [
168
+ "ball"
169
+ ]
170
+ },
171
+ {
172
+ "x": -570,
173
+ "y": -70,
174
+ "cMask": [
175
+ "ball"
176
+ ]
177
+ },
178
+ {
179
+ "x": -570,
180
+ "y": 70,
181
+ "cMask": [
182
+ "ball"
183
+ ]
184
+ },
185
+ {
186
+ "x": -570,
187
+ "y": 70,
188
+ "cMask": [
189
+ "ball"
190
+ ]
191
+ },
192
+ {
193
+ "x": -540,
194
+ "y": 70,
195
+ "cMask": [
196
+ "ball"
197
+ ]
198
+ },
199
+ {
200
+ "x": 540,
201
+ "y": -70,
202
+ "cMask": [
203
+ "ball"
204
+ ]
205
+ },
206
+ {
207
+ "x": 570,
208
+ "y": -70,
209
+ "cMask": [
210
+ "ball"
211
+ ]
212
+ },
213
+ {
214
+ "x": 570,
215
+ "y": -70,
216
+ "cMask": [
217
+ "ball"
218
+ ]
219
+ },
220
+ {
221
+ "x": 570,
222
+ "y": 70,
223
+ "cMask": [
224
+ "ball"
225
+ ]
226
+ },
227
+ {
228
+ "x": 570,
229
+ "y": 70,
230
+ "cMask": [
231
+ "ball"
232
+ ]
233
+ },
234
+ {
235
+ "x": 540,
236
+ "y": 70,
237
+ "cMask": [
238
+ "ball"
239
+ ]
240
+ },
241
+ {
242
+ "x": 0,
243
+ "y": -300,
244
+ "cGroup": [
245
+ "redKO",
246
+ "blueKO"
247
+ ],
248
+ "cMask": [
249
+ "red",
250
+ "blue"
251
+ ]
252
+ },
253
+ {
254
+ "x": 0,
255
+ "y": -65,
256
+ "cGroup": [
257
+ "redKO",
258
+ "blueKO"
259
+ ],
260
+ "cMask": [
261
+ "red",
262
+ "blue"
263
+ ]
264
+ },
265
+ {
266
+ "x": 0,
267
+ "y": 65,
268
+ "cGroup": [
269
+ "redKO",
270
+ "blueKO"
271
+ ],
272
+ "cMask": [
273
+ "red",
274
+ "blue"
275
+ ]
276
+ },
277
+ {
278
+ "x": 0,
279
+ "y": 300,
280
+ "cGroup": [
281
+ "redKO",
282
+ "blueKO"
283
+ ],
284
+ "cMask": [
285
+ "red",
286
+ "blue"
287
+ ]
288
+ }
289
+ ],
290
+ "segments": [
291
+ {
292
+ "v0": 0,
293
+ "v1": 1,
294
+ "curve": 0,
295
+ "cMask": [
296
+ "ball"
297
+ ],
298
+ "color": "72A99C",
299
+ "bCoef": 0.8
300
+ },
301
+ {
302
+ "v0": 2,
303
+ "v1": 3,
304
+ "curve": 0,
305
+ "cMask": [
306
+ "ball"
307
+ ],
308
+ "color": "72A99C",
309
+ "bCoef": 0.8
310
+ },
311
+ {
312
+ "v0": 4,
313
+ "v1": 5,
314
+ "curve": 0,
315
+ "cMask": [
316
+ "ball"
317
+ ],
318
+ "color": "72A99C",
319
+ "bCoef": 0.8
320
+ },
321
+ {
322
+ "v0": 6,
323
+ "v1": 7,
324
+ "curve": 0,
325
+ "cMask": [
326
+ "ball"
327
+ ],
328
+ "color": "72A99C",
329
+ "bCoef": 0.8
330
+ },
331
+ {
332
+ "v0": 8,
333
+ "v1": 9,
334
+ "curve": 0,
335
+ "cMask": [
336
+ "ball"
337
+ ],
338
+ "color": "72A99C",
339
+ "bCoef": 0.8
340
+ },
341
+ {
342
+ "v0": 10,
343
+ "v1": 11,
344
+ "curve": 0,
345
+ "cMask": [
346
+ "ball"
347
+ ],
348
+ "color": "72A99C",
349
+ "bCoef": 0.8
350
+ },
351
+ {
352
+ "v0": 12,
353
+ "v1": 13,
354
+ "curve": 90,
355
+ "cMask": [
356
+ "ball"
357
+ ],
358
+ "color": "72A99C",
359
+ "bCoef": 0.8
360
+ },
361
+ {
362
+ "v0": 14,
363
+ "v1": 15,
364
+ "curve": 90,
365
+ "cMask": [
366
+ "ball"
367
+ ],
368
+ "color": "72A99C",
369
+ "bCoef": 0.8
370
+ },
371
+ {
372
+ "v0": 16,
373
+ "v1": 17,
374
+ "curve": 90,
375
+ "cMask": [
376
+ "ball"
377
+ ],
378
+ "color": "72A99C",
379
+ "bCoef": 0.8
380
+ },
381
+ {
382
+ "v0": 18,
383
+ "v1": 19,
384
+ "curve": 90,
385
+ "cMask": [
386
+ "ball"
387
+ ],
388
+ "color": "72A99C",
389
+ "bCoef": 0.8
390
+ },
391
+ {
392
+ "v0": 20,
393
+ "v1": 21,
394
+ "curve": 0,
395
+ "cMask": [
396
+ "ball"
397
+ ],
398
+ "color": "3D7267",
399
+ "bCoef": 0.15
400
+ },
401
+ {
402
+ "v0": 22,
403
+ "v1": 23,
404
+ "curve": 0,
405
+ "cMask": [
406
+ "ball"
407
+ ],
408
+ "color": "3D7267",
409
+ "bCoef": 0.15
410
+ },
411
+ {
412
+ "v0": 24,
413
+ "v1": 25,
414
+ "curve": 0,
415
+ "cMask": [
416
+ "ball"
417
+ ],
418
+ "color": "3D7267",
419
+ "bCoef": 0.15
420
+ },
421
+ {
422
+ "v0": 26,
423
+ "v1": 27,
424
+ "curve": 0,
425
+ "cMask": [
426
+ "ball"
427
+ ],
428
+ "color": "3D7267",
429
+ "bCoef": 0.15
430
+ },
431
+ {
432
+ "v0": 28,
433
+ "v1": 29,
434
+ "curve": 0,
435
+ "cMask": [
436
+ "ball"
437
+ ],
438
+ "color": "3D7267",
439
+ "bCoef": 0.15
440
+ },
441
+ {
442
+ "v0": 30,
443
+ "v1": 31,
444
+ "curve": 0,
445
+ "cMask": [
446
+ "ball"
447
+ ],
448
+ "color": "3D7267",
449
+ "bCoef": 0.15
450
+ },
451
+ {
452
+ "v0": 32,
453
+ "v1": 33,
454
+ "vis": false,
455
+ "cGroup": [
456
+ "redKO",
457
+ "blueKO"
458
+ ],
459
+ "cMask": [
460
+ "red",
461
+ "blue"
462
+ ]
463
+ },
464
+ {
465
+ "v0": 34,
466
+ "v1": 35,
467
+ "vis": false,
468
+ "cGroup": [
469
+ "redKO",
470
+ "blueKO"
471
+ ],
472
+ "cMask": [
473
+ "red",
474
+ "blue"
475
+ ]
476
+ },
477
+ {
478
+ "v0": 34,
479
+ "v1": 33,
480
+ "curve": -180,
481
+ "vis": false,
482
+ "cGroup": [
483
+ "redKO"
484
+ ],
485
+ "cMask": [
486
+ "red",
487
+ "blue"
488
+ ]
489
+ },
490
+ {
491
+ "v0": 34,
492
+ "v1": 33,
493
+ "curve": 180,
494
+ "vis": false,
495
+ "cGroup": [
496
+ "blueKO"
497
+ ],
498
+ "cMask": [
499
+ "red",
500
+ "blue"
501
+ ]
502
+ }
503
+ ],
504
+ "planes": [
505
+ {
506
+ "normal": [
507
+ 0,
508
+ 1
509
+ ],
510
+ "dist": -300
511
+ },
512
+ {
513
+ "normal": [
514
+ 0,
515
+ -1
516
+ ],
517
+ "dist": -300
518
+ },
519
+ {
520
+ "normal": [
521
+ 1,
522
+ 0
523
+ ],
524
+ "dist": -590
525
+ },
526
+ {
527
+ "normal": [
528
+ -1,
529
+ 0
530
+ ],
531
+ "dist": -590
532
+ }
533
+ ],
534
+ "goals": [
535
+ {
536
+ "p0": [
537
+ -540,
538
+ -70
539
+ ],
540
+ "p1": [
541
+ -540,
542
+ 70
543
+ ],
544
+ "team": "red"
545
+ },
546
+ {
547
+ "p0": [
548
+ 540,
549
+ -70
550
+ ],
551
+ "p1": [
552
+ 540,
553
+ 70
554
+ ],
555
+ "team": "blue"
556
+ }
557
+ ],
558
+ "discs": [
559
+ {
560
+ "pos": [
561
+ -540,
562
+ -70
563
+ ],
564
+ "radius": 6,
565
+ "invMass": 0,
566
+ "color": "DAEEE4",
567
+ "bCoef": 0.5
568
+ },
569
+ {
570
+ "pos": [
571
+ -540,
572
+ 70
573
+ ],
574
+ "radius": 6,
575
+ "invMass": 0,
576
+ "color": "DAEEE4",
577
+ "bCoef": 0.5
578
+ },
579
+ {
580
+ "pos": [
581
+ 540,
582
+ -70
583
+ ],
584
+ "radius": 6,
585
+ "invMass": 0,
586
+ "color": "DAEEE4",
587
+ "bCoef": 0.5
588
+ },
589
+ {
590
+ "pos": [
591
+ 540,
592
+ 70
593
+ ],
594
+ "radius": 6,
595
+ "invMass": 0,
596
+ "color": "DAEEE4",
597
+ "bCoef": 0.5
598
+ }
599
+ ],
600
+ "ballPhysics": {
601
+ "radius": 9,
602
+ "damping": 0.991,
603
+ "bCoef": 0.6
604
+ },
605
+ "playerPhysics": {
606
+ "radius": 15,
607
+ "acceleration": 0.11,
608
+ "damping": 0.96,
609
+ "kickStrength": 5.5
610
+ }
611
+ }