Updated GameLib
@@ -74,9 +74,9 @@ Triggers when the endscreen should be shown.
|
|||||||
Controller.on('endScreen', (endScreen) => {});
|
Controller.on('endScreen', (endScreen) => {});
|
||||||
```
|
```
|
||||||
|
|
||||||
| Argument | Type | Description |
|
| Argument | Type | Description |
|
||||||
| --------- | ------------------------------------------- | ------------------- |
|
| --------- | ---------------------------------------- | ------------------- |
|
||||||
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen.md) | The endscreen data. |
|
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen) | The endscreen data. |
|
||||||
|
|
||||||
### on: queuePositionUpdate
|
### on: queuePositionUpdate
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,63 @@ Game.setMainScoreboard(scoreboard);
|
|||||||
|
|
||||||
### requestFromQueue
|
### requestFromQueue
|
||||||
|
|
||||||
|
Request a player from the queue. When the queue is empty it will return null.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Game.requestFromQueue();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Return** [GamePlayer](./ModuleServerAPIGameLibGamePlayer) _GamePlayer instance._
|
||||||
|
|
||||||
### removePlayer
|
### removePlayer
|
||||||
|
|
||||||
|
Remove a player from the game and show them their endscreen.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Game.removePlayer(clientId, endScreen);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| --------- | ---------------------------------------- | ---------------------------- |
|
||||||
|
| clientId | string | The client id of the player. |
|
||||||
|
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen) | The endscreen data. |
|
||||||
|
|
||||||
### getPlayer
|
### getPlayer
|
||||||
|
|
||||||
### getPlayers
|
Get a player in the game.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Game.getPlayer(clientId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ---------------------------- |
|
||||||
|
| clientId | string | The client id of the player. |
|
||||||
|
|
||||||
|
**Return** [GamePlayer](./ModuleServerAPIGameLibGamePlayer) _GamePlayer instance._
|
||||||
|
|
||||||
### hasPlayer
|
### hasPlayer
|
||||||
|
|
||||||
|
Check if a player is in the game.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Game.hasPlayer(clientId);
|
||||||
|
```
|
||||||
|
|
||||||
|
| Argument | Type | Description |
|
||||||
|
| -------- | ------ | ---------------------------- |
|
||||||
|
| clientId | string | The client id of the player. |
|
||||||
|
|
||||||
|
**Return** boolean _Player is in the game._
|
||||||
|
|
||||||
|
### getPlayers
|
||||||
|
|
||||||
|
Get the players in the game.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
Game.getPlayers();
|
||||||
|
```
|
||||||
|
|
||||||
|
**Return** [GamePlayer](./ModuleServerAPIGameLibGamePlayer)[] _GamePlayer instances._
|
||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|||||||
Reference in New Issue
Block a user