BattleShip Game or Sea Battle is a game for two players. It is played on ruled grids (paper or board) on which the players' fleets of ships (including battleships) are marked. The locations of the fleet are concealed from the other player. Players alternate turns calling "shots" at the other player's ships, and the objective of the game is to destroy the opposing player's fleet.
ServerSide
socket.IO, Node.js.
Pure Javascript and the HTML5 Canvas.
- Player can logon to the game using a nickname (no password needed) If nickname is already used by another user online, player should chose a different nickname.
- Player can see a list of other players currently not in a game
- Player can request to play with another player from above list
- Game proceed by turns, first player is the one that starts the game.
- All decision making is done on the server to prevent cheating.
+-------+
|clients| +-----------+
+---+---+ |random ship|
files sent to | |generator |
all clients +--v---+ +-------+---+
+---------------+server+-----------+ ^
| +----+-+ +--v--+ |
| | |users+------+ |
+---v---------------+ | +-----+ +--v----+---+
|client static files| | |game logics|
+--+----------------+ +------------+ +----^------+
| | |
+--------v--+ +-------+ +--v----+ |
|user logics+--------+->emiters<---------+emiters+-------+
+-------+---+ | +-------+ +-------+
| | +--------------^
+--------v----+ | socket.IO connection
| board Drawer| +v----------+
+-------------+ |game logics|
+-----------+