Added Working Playground

This commit is contained in:
2025-04-08 17:21:56 +02:00
parent a8220e6959
commit dcea0d24f5
7 changed files with 117 additions and 28 deletions

View File

@@ -0,0 +1,27 @@
import Loop from "./Loop.js";
import UIManager from "./UI/UIManager.js";
import Playground from "./Elements/Playground.js";
class Game{
/**@param {import("../../../../backend/node_modules/socket.io-client".Socket} socket Autocompletions VSC*/
constructor(socket) {
this.socket = socket;
this.loop = new Loop(this.socket, this);
this.uiManager = new UIManager();
this.playGround = undefined;
this.gameStarted = false;
this.socket.on("startGame", (data) => { this.start(data) });
}
start(playgroundSize){
this.gameStarted = true;
this.uiManager.loadGameContent();
this.playGround = new Playground(this, this.uiManager, playgroundSize);
}
}
export default Game;