Updated GameLib
@@ -74,9 +74,9 @@ Triggers when the endscreen should be shown.
|
||||
Controller.on('endScreen', (endScreen) => {});
|
||||
```
|
||||
|
||||
| Argument | Type | Description |
|
||||
| --------- | ------------------------------------------- | ------------------- |
|
||||
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen.md) | The endscreen data. |
|
||||
| Argument | Type | Description |
|
||||
| --------- | ---------------------------------------- | ------------------- |
|
||||
| endScreen | [EndScreen](./ModuleAPIGameLibEndScreen) | The endscreen data. |
|
||||
|
||||
### on: queuePositionUpdate
|
||||
|
||||
|
||||
@@ -52,12 +52,63 @@ Game.setMainScoreboard(scoreboard);
|
||||
|
||||
### 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
|
||||
|
||||
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
|
||||
|
||||
### 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
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user