diff --git a/public/room.html b/public/room.html index da191205c4043cf2ad2d4c2d5f77536d1f23db9e..81875d26cef7d10b3b3400b21087975f0b0030de 100644 --- a/public/room.html +++ b/public/room.html @@ -34,6 +34,7 @@ // Initialize game board function drawBoard(board) { + console.log(board); // Draw Connect4 grid based on board state ctx.clearRect(0, 0, canvas.width, canvas.height); for (let row = 0; row < ROWS; row++) { @@ -59,7 +60,6 @@ } canvas.addEventListener('click', (e) => { - if (winner !== null) return; const rect = canvas.getBoundingClientRect(); const x = e.clientX - rect.left; const col = Math.floor(x / CELL_SIZE); diff --git a/server.js b/server.js index 056eb348022f376fb70535aed43a7ceb67584c40..2f2f4c08eaf04b40189065340fe1573707fe2fda 100644 --- a/server.js +++ b/server.js @@ -54,6 +54,7 @@ io.on('connection', (socket) => { let startGame = (room, roomId) => { console.log("Two players on room " + roomId + ", game starting."); + console.log(room); io.to(roomId).emit('startGame', { board: room.gameState, currentPlayer: room.currentPlayer