Relative Content

Tag Archive for javascripttic-tac-toemultiplayer

Tic Tack Toe Multiplayer

I’m going to create a tic tac toe multiplayer game with sockets and cookies, where it can include two players who can choose their own name and color, the game has a play again button that restarts the game board but here comes my problem, everything works fine until you have to press the play again button, then the name and color are changed to the same as player 2. So if Player 1 is called p1 and has the color red and player 2 is called p2 with the color blue, then the color and name of player 1 are changed to p2 and the color blue so both players have the same name and color but the game is still distinguishing the players. Here is part of my code where I think I need to change but don’t know how, I have more code in other files that might affect too but please tell me what you think and I can fill in with more of the code in that case.