Othello is a classic strategy board game implemented using Python and Pygame. This project recreates the traditional game experience with engaging graphics and smooth gameplay mechanics.
WATCH THE OVERVIEW VIDEO
- Player vs Computer Mode: Play against ai using alpha-beta pruning algorithm
- Player vs Player Mode: Play against a friend on the same machine.
- Valid Move Highlighting: Shows the possible moves for the current player.
- Score Tracking: Displays real-time scores for both players.
- Python: Core programming language.
- Pygame: Game development library for rendering graphics and managing game states.
-
Clone the Repository:
git clone https://github.com/AhmedShaaban11/othello.git
-
Go to the game directory
cd othello -
Create a Virtual Environment (Recommended):
python -m venv venv source venv/Scripts/activate # On Windows with bash # or venv\Scripts\activate.bat # On Windows with cmd
-
Install Dependencies:
-
Ensure Python 3.x is installed.
-
Install dependencies using the requirements file:
pip install -r requirements.txt
-
If you encounter path issues, use the full Python path:
venv/Scripts/python.exe -m pip install -r requirements.txt
-
-
Run the Game:
python main.py
-
If you encounter "Unable to create process" errors, use the full Python path:
venv/Scripts/python.exe main.py
-
- Players take turns placing their pieces on the board.
- A valid move must capture at least one opponent piece.
- The game ends when neither player can make a valid move.
- The winner is the player with the most pieces on the board at the end.
-
Make sure you have activated your virtual environment first
-
If using a virtual environment, you can also run the game directly with:
venv/Scripts/python.exe main.py # On Windows
-
Ensure you have installed the dependencies:
pip install -r requirements.txt
-
If the above fails, try using the full Python path:
venv/Scripts/python.exe -m pip install -r requirements.txt
If you encounter errors like "Fatal error in launcher: Unable to create process", this usually means your virtual environment has path issues:
-
Deactivate and recreate the virtual environment:
deactivate rm -rf venv # Remove the old virtual environment python -m venv venv source venv/Scripts/activate pip install -r requirements.txt
-
Alternative: Use absolute paths without activating:
# Install dependencies ./venv/Scripts/python.exe -m pip install -r requirements.txt # Run the game ./venv/Scripts/python.exe main.py
If you encounter permission errors, try running your terminal as administrator or use:
python -m pip install --user -r requirements.txt