Creating a simple multiplayer game with JavaScript