diff --git a/client/public/scrabble/game.js b/client/public/scrabble/game.js new file mode 100644 index 0000000..e69de29 diff --git a/client/public/scrabble/index.html b/client/public/scrabble/index.html index e98577b..40e3afe 100644 --- a/client/public/scrabble/index.html +++ b/client/public/scrabble/index.html @@ -388,8 +388,10 @@ + + \ No newline at end of file diff --git a/client/public/scrabble/network.js b/client/public/scrabble/network.js new file mode 100644 index 0000000..7658187 --- /dev/null +++ b/client/public/scrabble/network.js @@ -0,0 +1,15 @@ + +// is game singleplayer? +const urlParser = new URLSearchParams(window.location.search); + +let isSingleplayer = false; +if (urlParser.get('id') === null) +{ + isSingleplayer = true; +} + +if (!isSingleplayer) +{ + // init socket +} + diff --git a/client/public/scrabble/pieces.js b/client/public/scrabble/pieces.js index 9cf8faf..b49abc7 100644 --- a/client/public/scrabble/pieces.js +++ b/client/public/scrabble/pieces.js @@ -74,7 +74,6 @@ function piecePickedUp(piece) { BoardSounds[2].play(); - piece.classList.add('dragging-piece'); } @@ -100,9 +99,9 @@ function piecePlaced(piece) { DrawerSounds[Math.floor(Math.random() * 3)].play(); - piece.classList.add('unplayed-piece'); piece.classList.remove('played-piece'); piece.classList.remove('dragging-piece'); + piece.classList.add('unplayed-piece'); delete piece.dataset.coords; setupPieces();