luisda190519 / BattleShip

recreate with Python the popular Battleship game.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BattleShip

For this problem you have been asked to recreate with Python the popular Battleship game. To do so, you should make use of the data structures you find most convenient, use classes and functions. Your task is to place the different ships on the board, which will be generated randomly according to the randomly generated according to the information provided by the user. Likewise, both the information information and the result must be obtained through a graphical interface. The ships to be located are:

  • Submarine: ship of size 1 in the grid.
  • Destroyer: ship of size 2 in the grid.
  • Cruiser: ship of size 3 in the grid.
  • Aircraft carrier: ship size 4 in the grid.

Installation

You must have python installed, and type the following command.

  $ pip install -r requirements.txt

Deployment

To deploy the game, run the main file, this can be done by executing the following command.

  python Battleship.py

Tech Stack

Game: Python, Pygame

Screenshots

When you start the game, the following screen will appear, press the button to start the game.

1

Then you will enter the type and number of ships the game will have.

2

At the start, each player's board will be shown in turn, he/she presses on a square, if he/she hits a ship it is his/her turn, if he/she misses, it will be the next player's turn.

3

In the end, the player who destroys all the other player's ships wins.

4

Acknowledgements

we could see how a videogame based on the famous battleship game was made, where we applied the most famous library for the creation of video games in python, which is pygame. pygame, as well as adding an interactive environment to offer a better experience to the users who will play the games. to the users that will play the games, and of course, complying with the requirements of the types of ships and the requirements of the types of ships. requirements or requirements of the types of ships and their random positioning on the board.

Support

For support, email licerol@uninorte.edu.co

Authors

About

recreate with Python the popular Battleship game.


Languages

Language:Python 100.0%