logoAyoub Omari

Dame Game

A sophisticated checker game implementation featuring player-vs-player and AI opponent modes.

4/1/2022 - 5/1/2022
GitHub
Posted on: 1/8/2025 | Edited on: 1/9/2025

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.

Game Preview 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:

Minimax Algorithm

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

  1. Clone the repository:
git clone https://github.com/ayoubomari/Dame.git
  1. Navigate to the project directory:
cd Dame
  1. Compile and run the application:
javac Main.java
java Main

Game Interface

Difficulty Selection AI difficulty selection screen

Gameplay Gameplay showing possible moves

How to Play

  1. Starting the Game

    • Choose between Player vs Player or Player vs AI
    • For AI mode, select your preferred difficulty level
  2. 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
  3. 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:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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!

Technologies used