Connect 4 game provides a great experience for players where each 2 players can enter a room and start their own challenge. Not only that, but players can enter the room as spectators and watch the ongoing game. Players are allowed to create their own rooms, accept or reject a player upon joining the room, choose their own board size for a leveled up challenge and pick a color for their coin to start playing.
- Player logs into the game, after entering a unique username.
- Player navigates through a menu, where he can enter play mode.
- Play mode allows player to view all online players, available free rooms and full rooms.
- Player can create a room then a dialog box appears requesting him to enter a unique room name, choose a suitable board size, choose his favourite color.
- After creating the room, player enters the room and waits for other player to join.
- If another player joined the room, the room owner then starts the game by pressing the play buttton.
- The winner gets a message to congratulate him, while the loser receives a message saying that he has lost.
- If a player wants to watch the game, he can select a room from the list of full rooms then press watch button.
- If player is done, he signs out from the game.
- Memento
- Singleton
- Classes Design UML and Sequence Diagram.
Request | Response | Details |
---|---|---|
log | ResponseLog | Player logs into the game, the server then receives that player |
showplayer | ResponseShowPlayer | Once the player logs in, the server responds with the online players list |
showrooms | ResponseShowRooms | Once the player logs in, the server responds with the online rooms list |
end | - | Specifies the end of list of rooms or players in server |
create | ResponseCreate | When a room is created, the player who created the room, id(room name), index(Size of board) are sent to the server to create the room, then server responds with the room created and player1 is assigned to that room |
join | ResponseJoin | Player 2 requests to join a room, server responds with the joined room and is redirects the player |
play | ResponsePlay | Player Sends the room ID to the server, then the server responds with the room where the game is created |
ConfigPlayer1 | - | Server waits for player 1 to play |
ConfigPlayer2 | - | Server waits for player 2 to play
|
ReceiveState |
ResponseRecieveState | Receives the state of board |
Exit |
- | Player is disconnected from server |
- Request user creation.
- View online players.
- View full rooms.
- View free rooms.
- Request room creation.
- Specify board size.
- Specify coin color.
- Join room as player.
- Join room as watcher.
- Create user.
- Create room.
- Instantiate game.
- Handle player's turn.
- Check player state.
- Run the server.
- Run the client.
- Enter username.
- Press Play.
- Press Create Room.
- Enter required data.
- Run another client.
- Navigate to Play.
- Double click on the shown room.
- The first client press play button.