Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
muktar1907 committed Apr 24, 2024
1 parent 102d78c commit 22ed2ce
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ <h1>The Word Search Game</h1>
gameIndex: gameIndex,
modeIndex: mode
};
//socket.send(JSON.stringify(data));

socket.send(JSON.stringify(data));
}

// replace leaveGame function with one that sends a WebSocket message
Expand Down Expand Up @@ -225,10 +226,11 @@ <h1>The Word Search Game</h1>
{
buttonEvent(this.getAttribute("id"),1);
});
cells[i].addEventListener("mousemove",function()
cells[i].addEventListener("mouseover",function()
{
this.style.backgroundColor="white";
buttonEvent(this.getAttribute("id"),2);
});

}
}
function buttonEvent(cell,action)
Expand All @@ -241,7 +243,11 @@ <h1>The Word Search Game</h1>
U.player=player;
U.gameId=gameId;

//socket.send(JSON.stringify(U));
var data = {
type: "UpdateGame",
events: U
};
socket.send(JSON.stringify(U));
console.log(JSON.stringify(U));
}
</script>
Expand Down

0 comments on commit 22ed2ce

Please sign in to comment.