Dame Game
A sophisticated desktop checkers game implemented in Java, featuring both player-vs-player and player-vs-AI gameplay modes. The AI opponent offers three difficulty levels powered by the Minimax algorithm.
Main game interface showing the checker board
Features
- 🎮 Two-player local multiplayer
- 🤖 Single-player mode against AI
- 🎯 Three AI difficulty levels (Easy, Medium, Hard)
- 📊 Real-time score tracking
- 🎨 Clean and intuitive user interface
- ♟️ Standard checkers rules implementation
AI Implementation
The game features an intelligent AI opponent implemented using the Minimax algorithm with Alpha-Beta pruning optimization for better performance.
How Minimax Works
The Minimax algorithm is a recursive decision-making algorithm used in game theory. It works by simulating all possible moves and their outcomes to determine the best move:
[Root Node]
/ | \
[A] [B] [C] MAX level
/ \ / \ / \
[D] [E] [F] [G][H] [I] MIN level
(4) (6) (2) (8)(1) (9) Evaluation scores
Example:
Key aspects of our implementation:
- The algorithm simulates the opponent making optimal moves
- Position evaluation considers:
- Piece count and king pieces
- Strategic board positions
- Available moves and mobility
- Board control and piece protection
Difficulty levels are implemented by adjusting search depth:
- Easy: 2 levels deep (quick decisions)
- Medium: 4 levels deep (balanced performance)
- Hard: 6 levels deep (more strategic play)
Getting Started
Prerequisites
- Java JDK 8 or higher
- Git (for cloning)
Installation
- Clone the repository:
git clone https://github.com/ayoubomari/Dame.git
- Navigate to the project directory:
cd Dame
- Compile and run the application:
javac Main.java
java Main
Game Interface
AI difficulty selection screen
Gameplay showing possible moves
How to Play
-
Starting the Game
- Choose between Player vs Player or Player vs AI
- For AI mode, select your preferred difficulty level
-
Game Controls
- Click to select your piece
- Click again on a highlighted square to move
- Double jumps are automatically enforced
- Pieces become kings when reaching the opposite end
-
Winning the Game
- Capture all opponent's pieces
- Or block all opponent's possible moves
Technologies Used
- Java (Core language)
- AWT (Abstract Window Toolkit)
- Swing (GUI components)
- Git & GitHub (Version control)
Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Acknowledgments
- Thanks to all contributors who helped shape this project
- Special thanks to the Java Swing community for resources and documentation
- Inspired by classic checkers games and AI implementations
Contact
Ayoub Omari - GitHub
Project Link: https://github.com/ayoubomari/Dame
⭐ Don't forget to give the project a star if you found it helpful!