Hinzufügen der Game Logik: Hinzufügen von Spieler-Management, Socket.IO-Integration und UI-Updates

This commit is contained in:
2025-04-01 16:16:26 +02:00
parent 5a2eaf74ca
commit 2c9a14db9a
10 changed files with 64 additions and 9 deletions

View File

@@ -4,8 +4,19 @@ class ServerConnectionManager {
this.socket = io(`${window.location.protocol}//${window.location.hostname}:${window.location.port}`);
this.basicSetup();
this.socket.on("waitForStart", (data) => {this.waitForStart(data)});
this.socket.on("randomTest", (data) => {this.randomTest(data)});
}
waitForStart(data) {
document.getElementById("pc").innerText = data;
}
randomTest(data) {
document.getElementById("rd").innerText = data;
}
basicSetup() {
this.socket.emit("hereForGame");