Schlangen werden angezeigt aber sind noch nicht bewegbar

This commit is contained in:
2025-04-10 21:04:52 +02:00
parent 125639cfa1
commit d669420a4f
9 changed files with 250 additions and 24 deletions

View File

@@ -15,7 +15,10 @@ class Game{
this.gameStarted = false;
this.ourColor = null;
this.socket.on("startGame", (data) => { this.start(data) });
this.socket.on("color", (data) => { this.setOutColor(data) })
}
start(playgroundSize){
@@ -25,6 +28,12 @@ class Game{
this.movementHandler = new MovementHandler(this.socket);
this.playGround = new Playground(this, this.uiManager, playgroundSize);
}
setOutColor(color){
this.ourColor = color;
this.uiManager.addSnakeColorInfo(color);
}
}
export default Game;