Alle Vorrausetzungwn fürs spielfeld geschrieben
This commit is contained in:
@@ -22,7 +22,10 @@ class Game{
|
||||
}
|
||||
|
||||
startGame(){
|
||||
this.io.to(`game-${this.code}`).emit("startGame");
|
||||
this.io.to(`game-${this.code}`).emit("startGame", {
|
||||
width: this.gameLoop.playground.width,
|
||||
height: this.gameLoop.playground.height
|
||||
});
|
||||
this.gameStarted = true;
|
||||
this.gameLoop.loop();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,11 @@ class GameLoop{
|
||||
loop(){
|
||||
this.io.to(`game-${this.game.code}`).emit("loop", {
|
||||
code: this.game.code,
|
||||
playground: this.playground
|
||||
playground: {
|
||||
height: this.playground.height,
|
||||
width: this.playground.width,
|
||||
tiles: this.playground.tiles,
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -7,7 +7,7 @@ class LobbyManager {
|
||||
/** @param {socketIO.Server} io */
|
||||
constructor(io) {
|
||||
this.io = io;
|
||||
|
||||
|
||||
/** @type {Map<string, Lobby>}*/
|
||||
this.lobbys = new Map();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user