Setting up things
Before we start writing any code, we need to put some things in place in order to have a proper foundation on which to rely on.
The server side
Every online game requires a game server of some kind and our game will be no exception. It will be used to keep tabs on all the connected players and will relay all the games' interactions to the players.
Our game server must meet the following requirements:
It must be accessible through a standardized protocol (HTTP in our case)
It should have Web Socket support
It should be easy to develop (we are the ones coding it after all)
There are a lot of web servers out there that can meet these requirements. All these requirements are based on different technologies under the hood, requiring us to master another language in order to use them. Also, we would need to have a conversion process in place in order to pass data between the server and the client. JavaScript can parse JSON and interpret them as native objects, but that isn't necessarily...