Stabilize WebGL flip reveal handoff

This commit is contained in:
2026-06-10 15:10:57 +02:00
parent 97eab216b7
commit ef358c5cfd
6 changed files with 186 additions and 41 deletions
+7 -4
View File
@@ -76,7 +76,7 @@ class GameLoopModule extends BaseModule {
return true;
}
start() {
async start() {
console.log("GameLoop: Starting game sequence...");
try {
@@ -87,12 +87,14 @@ class GameLoopModule extends BaseModule {
console.log("GameLoop: Setting up socket listeners and connecting...");
// Set up socket event listeners and connect
this.setupSocketEventListeners();
const connected = await this.setupSocketEventListeners();
// Set the game loop as running
this.isRunning = true;
return connected;
} catch (error) {
console.error("Error starting game loop:", error);
return false;
}
}
@@ -133,7 +135,7 @@ class GameLoopModule extends BaseModule {
if (!socketClient) {
console.error("Socket client module not found");
return;
return Promise.resolve(false);
}
// Connect UI controller to socket client for command handling
@@ -181,12 +183,13 @@ class GameLoopModule extends BaseModule {
});
// Connect to the socket server
socketClient.connect().then(success => {
return socketClient.connect().then(success => {
if (success) {
console.log("GameLoop: Socket connection established successfully.");
} else {
console.error("GameLoop: Failed to connect to socket server");
}
return success;
});
}