Change gameplay
This commit is contained in:
parent
d79900e3ea
commit
34dae300da
56 changed files with 906 additions and 400 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { CharacterTeam, PlayerInformation, Random } from 'shared';
|
||||
import { CharacterTeam, PlayerInformation, Random, TransportEvents } from 'shared';
|
||||
import { PhysicalContainer } from '../physics/containers/physical-container';
|
||||
import { Player } from './player';
|
||||
|
||||
|
|
@ -32,6 +32,10 @@ export class PlayerContainer {
|
|||
this.players.forEach((p) => p.step(deltaTimeInSeconds));
|
||||
}
|
||||
|
||||
public sendOnSocket(message: any) {
|
||||
this.players.forEach((p) => p.socket.emit(TransportEvents.ServerToPlayer, message));
|
||||
}
|
||||
|
||||
private getTeamOfNextPlayer(): CharacterTeam {
|
||||
const declaCount = this._players.filter((p) => p.team === CharacterTeam.decla).length;
|
||||
const redCount = this._players.filter((p) => p.team === CharacterTeam.red).length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue