https://github.com/viniciusfer01/naval_warfare
A fun little "Batalha Naval" university project, using websockets. IMD0812 - JOGOS EM REDE MULTIUSUÁRIOS
https://github.com/viniciusfer01/naval_warfare
nodejs reactjs websocket-client websockets websockets-server
Last synced: 3 months ago
JSON representation
A fun little "Batalha Naval" university project, using websockets. IMD0812 - JOGOS EM REDE MULTIUSUÁRIOS
- Host: GitHub
- URL: https://github.com/viniciusfer01/naval_warfare
- Owner: viniciusfer01
- Created: 2024-04-02T16:04:49.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T17:42:39.000Z (over 2 years ago)
- Last Synced: 2025-01-27T08:44:09.606Z (over 1 year ago)
- Topics: nodejs, reactjs, websocket-client, websockets, websockets-server
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Naval Warfare
## Implementation details
For now, the game board is static and the same for both players. The purpose of this is to focus more on the game logic and the multiplayer aspect of the game. If a player hits all of the other player's ships, the game will end. and the player will be declared the winner. The game will then end and the players can play again by refreshing their clients.
## Description
This is a multiplayer naval warfare game. The game is played on a 10x10 grid. Each player has 5 ships to place on the grid. The ships are: Carrier (5 spaces), Battleship (4 spaces), Cruiser (3 spaces), Submarine (3 spaces), and Destroyer (2 spaces). The players take turns guessing the location of the other player's ships. The game ends when all of one player's ships have been sunk.
## How to Play
Open two instances of the client in your browser. Then try to guess where the other
player's ships are located. The game will tell you if you hit or missed. The game ends when all of one player's ships have been sunk.
## How to Run
cd into the server directory and run the following commands:
```
# Install dependencies
$ npm install
# Start the server
$ npm start
```
cd into the client directory and run the following commands:
```
# Install dependencies
$ npm install / yarn
# Start the server
$ npm start / yarn dev
```
Then navigate to `http://localhost:port/` in your browser.
the port number will be displayed in the terminal where you started the client.