diff --git a/public/gameClient.js b/public/gameClient.js index f686b7f7c87715f0a645ca0fc8b4a7f258631277..d71bb28f4e0a6d003be411e4b67437135d67becc 100644 --- a/public/gameClient.js +++ b/public/gameClient.js @@ -31,6 +31,14 @@ let gameBoardHandler = (event) => { let board = event.data; widthStep = width / board[0].length; heightStep = height / board.length; + + let coordsDiv = document.getElementById("snakeCoords"); + let sizeDiv = document.getElementById("snakeSize"); + + if (event.headPosition && event.bodySize) { + coordsDiv.innerText = `Coords: (${event.headPosition.x}, ${event.headPosition.y})`; + sizeDiv.innerText = `Size: ${event.bodySize}`; + } for (let i = 0; i < board.length; i++) { for (let j = 0; j < board[i].length; j++) {