The Conqueror is a turn-based grand strategy game developed entirely in Java. Inspired by classic empire-building titles, the game challenges players to manage resources, build cities, raise armies, and conquer a map of ancient-world powers. Choose a faction, expand your territory, and lead your armies to victory!
This project is a demonstration of core software engineering principles, including Object-Oriented Programming and GUI development, all implemented from the ground up.




[Walkthrough]https://drive.google.com/file/d/1k7qOO0KgKZbeLP-OOYfdZPMhOYQXzKW-/view?usp=drive_link
- Turn-Based Strategy: Plan your moves, manage your empire, and end your turn to see the world react.
- Faction Selection: Start your journey as one of three iconic cities: Rome, Sparta, or Cairo.
- Army Management: Recruit and command armies composed of three distinct unit types: Archers, Infantry, and Cavalry.
- City Development: Construct a variety of economic and military buildings, including Farms, Markets, Barracks, and Stables, each with unique benefits.
- Resource Management: Balance your treasury (Gold) and food supplies. Levy taxes and harvest food to fund your military and avoid starvation.
- World Map & Combat: Move armies across the map to besiege and attack enemy cities. Engage in an auto-resolved combat system to determine the victor.
- Dynamic GUI: An interactive user interface built with Java Swing allows for intuitive control over all aspects of the game.
This project was built to showcase robust software architecture and a deep understanding of Java.
- Language: Java SE
- UI Framework: Java Swing for the graphical user interface.
- Design Patterns & Principles:
- Model-View-Controller (MVC): The project is cleanly structured to separate concerns:
- Model: The
engine
package contains all the core game logic, state, and rules (e.g.,Game.java
,Player.java
,City.java
). It is completely independent of the user interface. - View: The
view
package contains all GUI components, responsible for presenting the game state to the user (e.g.,WorldMap.java
,CityView.java
). - Controller: Event listeners (
ActionListener
) within the view classes handle user input and translate it into actions on the model.
- Model: The
- Object-Oriented Programming (OOP): The game is built on strong OOP principles. Clear class hierarchies are used to model game entities, for example:
Unit
is the base abstract class forArcher
,Infantry
, andCavalry
.Building
is the base class forEconomicBuilding
andMilitaryBuilding
, which are further extended by specific building types likeFarm
andBarracks
.
- Data-Driven Design: Initial game setup (e.g., city locations, distances, and starting armies) is loaded from external
.csv
files. This makes the game highly configurable and scalable without altering the source code.
- Model-View-Controller (MVC): The project is cleanly structured to separate concerns:
- Custom Exception Handling: A comprehensive custom exception hierarchy is defined in the
exceptions
package. This allows for specific and graceful handling of game-rule violations and invalid user actions (e.g.,NotEnoughGoldException
,FriendlyCityException
,MaxLevelException
).
- Compile the code:
Navigate to the
src
directory and compile all.java
files into thebin
directory.javac -d ../bin ./**/*.java
- Run the game:
Navigate to the
bin
directory and run the main entry point of the application.cd ../bin java view.StartScreen
This README was generated by GitHub Copilot based on a scan of the project's source code.