This is a simple, interactive combat game built using Python and Pygame, offering a fun grid-based combat experience between a human player and an AI opponent. Players can select difficulty levels (Easy, Moderate, Hard), place their ships, and engage in strategic turn-based attacks, all within a visually appealing UI rendered via Pygame.
Choose from Easy (6×6), Moderate (8×8), or Hard (10×10) game boards for varying complexity.
Place 8 ships on your grid by clicking cells on the left board before starting the game.
AI randomly places its ships and responds with basic strategic attacks after your turn.
Players and AI take turns attacking each other's grids — green circles indicate hits, black for misses.
A message panel and ship hit counter keeps players informed about the current state of the match.
The first to sink all 8 enemy ships wins the game. Game over messages are shown at the end.
Programming Language: Python 3.X
Libraries: Pygame ( for graphics, events, rendering ), NumPy( for Grid )
Core Concepts:
⊡ Event-driven programming
⊡ Grid generation using NumPy
⊡ Collision handling (mouse clicks & grid mapping)
⊡ Turn-based state machine logic
⊡ AI logic with random attack generation
🔧 Setup:
1. Make sure Python 3.x is installed.
2. Install Pygame if not already:
pip install pygame
1. Copy the source code from the file : src.py
2. Paste the code on a Python file & save it as ' The Conquerer.py '.
🎮 Controls:
1. Click on the grid boxes on Left board to place your ships( BLUE boxes ).
2. Click on grid boxes on Right board to fire shots on AI's ships( GREEN dots ).
I’d love to hear from you!
If you encounter any Bugs, Issues, or have Suggestions for improvements.
If you like ❤️ this project, give it a ⭐ (Top right of page) and share it with friends!