add basic updating to client on physics
This commit is contained in:
parent
95e0f6b710
commit
1027d980c1
15 changed files with 160 additions and 13 deletions
|
@ -12,10 +12,13 @@ class GameServer {
|
|||
|
||||
assignRoom(player) {
|
||||
let room = Array.from(this.rooms.values()).sort((a, b) => {
|
||||
return a.players - b.players;
|
||||
return a.playerCount - b.playerCount;
|
||||
})[0];
|
||||
|
||||
if (!room || room.full) room = new Room();
|
||||
if (!room || room.full) {
|
||||
room = new Room();
|
||||
this.rooms.set(room.name, room);
|
||||
}
|
||||
|
||||
room.add(player);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue