jaxonavena / Battleship

1 stars 1 forks source link

Battleship Game Project

Introduction

This is a Python implementation of the classic game Battleship, where two players place ships on a 10x10 grid and take turns attacking each other's ships. The first player to sink all of their opponent's ships wins the game.

The game uses object-oriented programming concepts and is broken down into several modules, including GameObject, Player, Game, Ship, and Tile.

How to Run

To start the game:

  1. Ensure you have Python installed.
  2. Clone or download this repository.
  3. Navigate to the project directory and run the following command: python main.py

Game Flow

Key Classes and Methods

GameObject

This is the base class that contains common utilities and methods like:

Player

Manages individual player actions and information, including:

Game

Handles the overall game flow, including:

Ship

Represents individual ships with attributes like:

Tile

Represents a single tile on the board. Each tile knows its position and can change its symbol based on game events.

Features

Future Improvements