Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
prasannjeet committed Apr 14, 2019
1 parent 15cc89b commit 3d32e52
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ This will start the angular server. The game can be played at http://localhost:4
## Time Taken
Total time taken to build the game was 14-15 hours.

## Game Workflow
Following are the sequence of events in the perspective of an end user that take place in one instance of a game:
1. The user lands on the first page where they enter their username and submits.
2. User can then see two boards on his screen. The left one represents their own board with randomly placed ships, and the right one represents enemy's (Player - 2) empty board, as they cannot se the enemy's ship positions.
3. User can then see a *link* at the bottom of the screen that they can share over the internet with their friend who can play against them.
4. The link can then be opend by Player - 2 in their own browser. The entry screen with be similar to what Player 1 sees: A form where user can enter their username, followed by the screen where two boards are present, as discussed above, point 2. Further, Player 2 can also see the username of Player 1 at the bottom of the screen against whom they are playing.
5. As soon as Player 2 enters their username, it will then be visible to Player 1 at the bottom of their screen, mentioning that they have joined the game.
6. Player 2 get the chance to play first. They are allowed to attack at any of the 64 blocks in the *right* side of the screen. Any block attacked will then be also visible in the *left* side of the screen screen for Player 1, marked in *red*. However, if a player is successful in attacking a block where ship is present, a *fire* icon can be seen instead of *red* color, and this will be reflected to both the players.
7. The first player to successfully attack all the ships at all positions wins the game.
8. The link to the Score Table can be seen at the bottom of the screen for both the players.

---
## Spring Boot Backend
The project follows MVC Design Pattern. The `model` package contains all the models. Cookies or Sessions are not used. The server persists the game data in it's database, and remembers the players via the websocket messages.
Expand Down Expand Up @@ -123,6 +112,17 @@ Both are the same design and almost same functions. They are the main web-app fo
- A scorecard, as mentioned above, is also implemented.
- Users can also see an error message if, for any reason, the websockets connection is lost with the server.

## Game Workflow
Following are the sequence of events in the perspective of an end user that take place in one instance of the game: Assuming the players are John and Jane,
1. John lands on the first page where he enters his username and submits.
2. John can then see two boards on his screen. The left one represents his own board with randomly placed ships, and the right one represents Jane's (note that Jane is yet to join the game) empty board, as he cannot se the her ship positions.
3. John can then see a *link* at the bottom of the screen that he can share over the internet with Jane who can play against him.
4. The link can then be opend by Jane in her own browser. The entry screen will be similar to what John sees: A form where she can enter her username, followed by the screen where two boards are present, as discussed in point 2 above. Further, she can also see the username of John at the bottom of the screen, as it's John against whom she is playing.
5. As soon as Jane enters her username, it will then be visible to John at the bottom of his screen, mentioning that she hs joined the game.
6. Jane gets the chance to play first. She is allowed to attack at any of the 64 blocks ofn the *right* side of the screen. Any block attacked will then be visible in the *left* side of the John's screen as well, marked in *red*. However, if a she is successful in attacking a block where John's ship is present, a *fire* icon can be seen instead of *red* color, and this will be reflected to both the players.
7. The first player to successfully attack all the ships at all positions wins the game.
8. The link to view the Score Table can be seen at the bottom of the screen for both the players.

## Limitations
One or many of these limitations could have been resolved with more time in hand.

Expand Down

0 comments on commit 3d32e52

Please sign in to comment.