- A classic rock, paper and scissors game
- Any two remote players can enter a game room and play the game
- Server capable of handling multiple games being played across multiple rooms simultaneously
- Graceful shutdown when a player leaves room
- Latency less than 30ms
- Uses socket.io to implement real time communication.
- Player 1 opens a room with any room code.
- Sends room code to Player 2.
- Player 2 joins room with given room code. Once both players present in room, game starts.
- Server maintains an instance of game logic against the room code and broadcasts state of game to all sockets belonging to a room. While, each client emits player’s choice to the server. Game logic is entirely handled on server side and client maintains only the present state of game.