hytopia 0.1.71 → 0.1.73
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/docs/server.eventrouter.emit.md +20 -4
- package/docs/server.eventrouter.md +43 -1
- package/docs/server.eventrouter.on.md +1 -1
- package/docs/server.eventrouter.once.md +69 -0
- package/docs/server.eventrouter.prependon.md +69 -0
- package/docs/server.eventrouter.prependonce.md +69 -0
- package/docs/server.md +0 -11
- package/docs/server.rigidbody.md +14 -0
- package/docs/server.rigidbody.setcollisiongroupsforsensorcolliders.md +53 -0
- package/examples/hole-in-wall-game/README.md +5 -0
- package/examples/hole-in-wall-game/assets/audio/music.mp3 +0 -0
- package/examples/hole-in-wall-game/assets/map.json +8110 -0
- package/examples/hole-in-wall-game/assets/textures/water.png +0 -0
- package/examples/hole-in-wall-game/assets/ui/index.html +269 -0
- package/examples/hole-in-wall-game/index.ts +370 -0
- package/examples/hole-in-wall-game/package.json +16 -0
- package/examples/hole-in-wall-game/wall-shapes.ts +145 -0
- package/examples/wall-dodge-game/README.md +6 -0
- package/package.json +1 -1
- package/server.api.json +302 -96
- package/server.d.ts +38 -23
- package/server.js +80 -80
- package/docs/server.event_2.md +0 -76
- package/docs/server.event_2.payload.md +0 -13
- package/docs/server.event_2.type.md +0 -13
@@ -9,7 +9,7 @@ Emit an event, invoking all registered listeners for the event type.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
emit<TPayload>(
|
12
|
+
emit<TPayload>(eventType: string, payload: TPayload): boolean;
|
13
13
|
```
|
14
14
|
|
15
15
|
## Parameters
|
@@ -32,17 +32,33 @@ Description
|
|
32
32
|
</th></tr></thead>
|
33
33
|
<tbody><tr><td>
|
34
34
|
|
35
|
-
|
35
|
+
eventType
|
36
36
|
|
37
37
|
|
38
38
|
</td><td>
|
39
39
|
|
40
|
-
|
40
|
+
string
|
41
41
|
|
42
42
|
|
43
43
|
</td><td>
|
44
44
|
|
45
|
-
The event to emit.
|
45
|
+
The type of event to emit.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
payload
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
TPayload
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The payload to emit.
|
46
62
|
|
47
63
|
|
48
64
|
</td></tr>
|
@@ -213,7 +213,7 @@ Description
|
|
213
213
|
</th></tr></thead>
|
214
214
|
<tbody><tr><td>
|
215
215
|
|
216
|
-
[emit(
|
216
|
+
[emit(eventType, payload)](./server.eventrouter.emit.md)
|
217
217
|
|
218
218
|
|
219
219
|
</td><td>
|
@@ -266,5 +266,47 @@ Remove all listeners for a specific event type.
|
|
266
266
|
Register a listener for a specific event type.
|
267
267
|
|
268
268
|
|
269
|
+
</td></tr>
|
270
|
+
<tr><td>
|
271
|
+
|
272
|
+
[once(eventType, listener)](./server.eventrouter.once.md)
|
273
|
+
|
274
|
+
|
275
|
+
</td><td>
|
276
|
+
|
277
|
+
|
278
|
+
</td><td>
|
279
|
+
|
280
|
+
Register a listener for a specific event type that will be invoked once.
|
281
|
+
|
282
|
+
|
283
|
+
</td></tr>
|
284
|
+
<tr><td>
|
285
|
+
|
286
|
+
[prependOn(eventType, listener)](./server.eventrouter.prependon.md)
|
287
|
+
|
288
|
+
|
289
|
+
</td><td>
|
290
|
+
|
291
|
+
|
292
|
+
</td><td>
|
293
|
+
|
294
|
+
Register a listener for a specific event type that will be invoked before all other existing listeners.
|
295
|
+
|
296
|
+
|
297
|
+
</td></tr>
|
298
|
+
<tr><td>
|
299
|
+
|
300
|
+
[prependOnce(eventType, listener)](./server.eventrouter.prependonce.md)
|
301
|
+
|
302
|
+
|
303
|
+
</td><td>
|
304
|
+
|
305
|
+
|
306
|
+
</td><td>
|
307
|
+
|
308
|
+
Register a listener for a specific event type that will be invoked once before all other existing listeners.
|
309
|
+
|
310
|
+
|
269
311
|
</td></tr>
|
270
312
|
</tbody></table>
|
@@ -69,5 +69,5 @@ void
|
|
69
69
|
|
70
70
|
## Remarks
|
71
71
|
|
72
|
-
|
72
|
+
Listeners are invoked in the order they are registered.
|
73
73
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [EventRouter](./server.eventrouter.md) > [once](./server.eventrouter.once.md)
|
4
|
+
|
5
|
+
## EventRouter.once() method
|
6
|
+
|
7
|
+
Register a listener for a specific event type that will be invoked once.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
once<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
eventType
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
string
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The type of event to listen for.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
listener
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
(payload: TPayload) => void
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The listener function to invoke when the event is emitted.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
void
|
69
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [EventRouter](./server.eventrouter.md) > [prependOn](./server.eventrouter.prependon.md)
|
4
|
+
|
5
|
+
## EventRouter.prependOn() method
|
6
|
+
|
7
|
+
Register a listener for a specific event type that will be invoked before all other existing listeners.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
prependOn<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
eventType
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
string
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The type of event to listen for.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
listener
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
(payload: TPayload) => void
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The listener function to invoke when the event is emitted.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
void
|
69
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [EventRouter](./server.eventrouter.md) > [prependOnce](./server.eventrouter.prependonce.md)
|
4
|
+
|
5
|
+
## EventRouter.prependOnce() method
|
6
|
+
|
7
|
+
Register a listener for a specific event type that will be invoked once before all other existing listeners.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
prependOnce<TPayload>(eventType: string, listener: (payload: TPayload) => void): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
eventType
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
string
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The type of event to listen for.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
<tr><td>
|
50
|
+
|
51
|
+
listener
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
(payload: TPayload) => void
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The listener function to invoke when the event is emitted.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
</tbody></table>
|
66
|
+
**Returns:**
|
67
|
+
|
68
|
+
void
|
69
|
+
|
package/docs/server.md
CHANGED
@@ -681,17 +681,6 @@ Options for creating a Collider instance.
|
|
681
681
|
Options for creating an Entity instance.
|
682
682
|
|
683
683
|
|
684
|
-
</td></tr>
|
685
|
-
<tr><td>
|
686
|
-
|
687
|
-
[Event\_2](./server.event_2.md)
|
688
|
-
|
689
|
-
|
690
|
-
</td><td>
|
691
|
-
|
692
|
-
An EventRouter event.
|
693
|
-
|
694
|
-
|
695
684
|
</td></tr>
|
696
685
|
<tr><td>
|
697
686
|
|
package/docs/server.rigidbody.md
CHANGED
@@ -1219,6 +1219,20 @@ Sets the angular velocity of the rigid body.
|
|
1219
1219
|
Sets whether the rigid body has continuous collision detection enabled.
|
1220
1220
|
|
1221
1221
|
|
1222
|
+
</td></tr>
|
1223
|
+
<tr><td>
|
1224
|
+
|
1225
|
+
[setCollisionGroupsForSensorColliders(collisionGroups)](./server.rigidbody.setcollisiongroupsforsensorcolliders.md)
|
1226
|
+
|
1227
|
+
|
1228
|
+
</td><td>
|
1229
|
+
|
1230
|
+
|
1231
|
+
</td><td>
|
1232
|
+
|
1233
|
+
Sets the collision groups for sensor colliders of the rigid body.
|
1234
|
+
|
1235
|
+
|
1222
1236
|
</td></tr>
|
1223
1237
|
<tr><td>
|
1224
1238
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [RigidBody](./server.rigidbody.md) > [setCollisionGroupsForSensorColliders](./server.rigidbody.setcollisiongroupsforsensorcolliders.md)
|
4
|
+
|
5
|
+
## RigidBody.setCollisionGroupsForSensorColliders() method
|
6
|
+
|
7
|
+
Sets the collision groups for sensor colliders of the rigid body.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
setCollisionGroupsForSensorColliders(collisionGroups: CollisionGroups): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
collisionGroups
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
[CollisionGroups](./server.collisiongroups.md)
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The collision groups for sensor colliders of the rigid body.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|
Binary file
|