https://github.com/soumyac1999/cs251-battleship
Course Project for Software Systems Lab. Battleship Game was implemented using Django and django-channels for the backend and React, HTML, and JS for the frontend.
https://github.com/soumyac1999/cs251-battleship
battleship-game django javascript
Last synced: 4 months ago
JSON representation
Course Project for Software Systems Lab. Battleship Game was implemented using Django and django-channels for the backend and React, HTML, and JS for the frontend.
- Host: GitHub
- URL: https://github.com/soumyac1999/cs251-battleship
- Owner: soumyac1999
- Created: 2018-12-19T18:20:08.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T18:57:48.000Z (over 6 years ago)
- Last Synced: 2024-12-30T21:41:45.135Z (6 months ago)
- Topics: battleship-game, django, javascript
- Language: HTML
- Homepage:
- Size: 1.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CS251-Battleship
An online version of the Battleship Game with some additional features for CS-251 Course Project.
## Guide To Run Server
- Find your ip address by running the following command in a terminal
ifconfig
- Add your ip address in the file `CS251-Battleship/Battleship/Battleship/settings.py` inside the list `ALLOWED_HOSTS` at line 28
- Run `build.sh` with `sudo` permissions to install the required dependencies and start the server as:
sudo bash build.sh
- If all the dependencies are already installed then, run the following to start the server:
bash run.sh
- Login credentials for Django admin:
- Username: admin
- Password: admin
## Guide to Start Playing
- Get the ip address of the server ``
- Head to a browser and go to `:8000/`
- Login with your existing credentials or create a new account
- You are now at your profile page. Click on Begin Game to see the list of available players
## Guide to Play
- Click on any user to send them a play request
- Once the player accepts your request, you will be redirected to page where you will have to place your ships.
- Instructions for placing ships:
- To place a ship on the board, first click the ship's shape to select it and then click a location on the board. The square marked by an 'X' will be placed at the clicked location.
- To rotate a ship and place it, first click the ship's shape to select it. Any subsequent clicks on the same shape will rotate it. Place on the board as before.
- After completing placing of all ships, click the Submit button.
- Once your opponent finishes placing their ships, both of you will be directed to the game page
- Each player is given a chance to shoots at their opponent's ships alternatively. Each turn lasts for 20 seconds after which you forfeit you turn and the opponent plays. For a correct move you get another move.
- Enjoy the game :smiley:
## Scoring
- For each correct shot fired in time `t` seconds the player is awarded `20-t` points
- For each wrong shot fired, no points are awarded or deducted
- At the end of the game, the winner is awarded points equal the sum of points awarded at each move
## Dependencies
- __Linux__
- Python Dev
- Redis
- Net Tools
- __Python__
- Django == 2.1.3
- Django Crispy Forms == 1.7.2
- Channels == 2.1.5
- Django Picklefield == 1.1.0
- Channels-Redis == 2.3.1
## An Example Placing of Ships
## An Example Game (Just started playing)
