Change gameplay

This commit is contained in:
schmelczerandras 2020-10-24 22:24:27 +02:00
parent d79900e3ea
commit 34dae300da
56 changed files with 906 additions and 400 deletions

View file

@ -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;