SkillAgentSearch skills...

Chess

Chess is a chess game (Multiplayer and Singleplayer) written in Flutter using Flame engine

Install / Use

/learn @shenmareparas/Chess
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<a href='https://play.google.com/store/apps/details?id=com.shenmareparas.chess'><img alt='Chess App Icon' src="https://github.com/shenmareparas/Chess/assets/112749923/54c38dbd-7a06-416e-8419-09f27654cbcd" width = 250/></a>

♟️ AI Chess - Flutter Chess Game

A feature-rich chess application built with Flutter and Flame engine, offering both single-player AI modes with varying difficulty levels and offline two-player gameplay. The app features beautiful customizable themes, multiple piece styles, and a powerful chess AI powered by the minimax algorithm with alpha-beta pruning.

Flutter Dart License

<a href='https://play.google.com/store/apps/details?id=com.shenmareparas.chess'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' width='300px'/></a>

✨ Features

🎮 Game Modes

  • Single Player: Play against an intelligent AI opponent with 5 difficulty levels
  • Two Player Mode: Offline multiplayer on the same device
  • Side Selection: Choose to play as white, black, or random
  • Timed Games: Optional time controls for competitive play

🎨 Customization

  • 8 Beautiful Themes: Including Grey, Dark, Amoled, Lewis, Cherry Funk, Sage, Warm Tan, and Jargon Jade
  • 7 Piece Themes: Classic, Angular, 8-Bit, Letters, Video Chess, Lewis Chessmen, and Mexico City
  • Dark Mode Support: Multiple dark theme options including pure AMOLED black
  • Custom Font: Jura font for elegant typography

🎯 Gameplay Features

  • Move History: Track all moves throughout the game using Standard Algebraic Notation (SAN)
  • Undo/Redo: Take back moves or replay them (configurable)
  • Move Hints: Visual indicators for valid moves
  • Board Notation: Algebraic notation (a-h, 1-8) coordinates on the board borders
  • Sound Effects: Audio feedback for piece movements
  • Board Rotation: Automatic board rotation based on turn
  • Promotion Handling: Full support for pawn promotion
  • Check Detection: Visual indicators for check and checkmate
  • Stalemate Detection: Proper game-end condition handling

🤖 AI Features

  • 5 Difficulty Levels: From beginner to expert (depth 1-5)
  • Minimax Algorithm: With alpha-beta pruning optimization
  • Iterative Deepening: Ensures best move ordering
  • Quiescence Search: Avoids horizon effect for captures
  • Null Move Pruning & LMR: Advanced search optimizations
  • Opening Book: Pre-calculated moves for distinct openings

📸 Screenshots

Add your app screenshots here

🛠️ Technologies Used

📦 Installation

Prerequisites

  • Flutter SDK (3.0.0 or higher)
  • Dart SDK (3.0.0 or higher)
  • Android Studio / Xcode (for mobile development)
  • A device or emulator

Steps

  1. Clone the repository

    git clone https://github.com/shenmareparas/Chess.git
    cd Chess
    
  2. Install dependencies

    flutter pub get
    
  3. Run the app

    flutter run
    
  4. Build for production (optional)

    # Android
    flutter build apk --release
    
    # iOS
    flutter build ios --release
    

📁 Project Structure

lib/
├── main.dart                 # App entry point
├── model/
│   ├── app_model.dart       # Main app state management
│   ├── app_themes.dart      # Theme definitions
│   ├── user_preferences.dart # SharedPreferences wrapper
│   └── player.dart          # Player enumerations
├── logic/
│   ├── chess_board.dart     # Board logic
│   ├── chess_game.dart      # Game controller
│   ├── chess_piece.dart     # Piece models
│   ├── chess_piece_sprite.dart  # Piece rendering
│   ├── shared_functions.dart    # Utility functions
│   ├── game_state_storage.dart  # History & undo/redo
│   ├── timer_service.dart   # Game clocks
│   ├── audio_service.dart   # Sound manager
│   └── move_calculation/    # Move validation and AI logic
└── views/
    ├── main_menu_view.dart  # Main menu screen
    ├── chess_view.dart      # Game screen
    ├── settings_view.dart   # Settings screen
    └── components/          # Reusable UI components

🧠 AI Algorithm

The chess AI uses the Minimax algorithm with alpha-beta pruning to determine optimal moves:

How It Works

  1. Minimax Algorithm: Evaluates the game tree by simulating moves and counter-moves
  2. Alpha-Beta Pruning: Optimizes search by eliminating branches that won't affect the final decision
  3. Advanced Optimizations: Utilizes Quiescence Search, Null Move Pruning, and Late Move Reductions (LMR)
  4. Depth-Based Difficulty:
    • Level 1: Depth 1 (1 half-move lookahead)
    • Level 2: Depth 2 (1 full move)
    • Level 3: Depth 3 (1.5 full moves)
    • Level 4: Depth 4 (2 full moves)
    • Level 5: Depth 5 (2.5 full moves)

Position Evaluation

The AI evaluates positions based on:

  • Material advantage (piece values)
  • Piece positioning and mobility
  • King safety
  • Pawn structure
  • Control of center squares

Learn more: Alpha-Beta Pruning on Wikipedia

⚙️ Configuration

The app stores user preferences locally using SharedPreferences:

  • Selected theme
  • Piece theme preference
  • Move history visibility
  • Sound settings
  • Hint display settings
  • Board Rotation preference
  • Board Notation visibility
  • Undo/Redo availability

🎯 Usage

  1. Start a New Game: From the main menu, configure your game settings
  2. Select Mode: Choose between 1-player (vs AI) or 2-player mode
  3. Choose Difficulty: For AI games, select from 5 difficulty levels
  4. Customize: Pick your preferred theme and piece style
  5. Play: Tap pieces to select them, then tap valid squares to move

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License.

👨‍💻 Author

Paras Shenmare

🙏 Acknowledgments

  • Chess piece graphics from various open-source sets
  • Jura font by Daniel Johnson
  • Flutter and Flame communities

📞 Support

If you encounter any issues or have suggestions, please open an issue.


⭐ If you like this project, please give it a star on GitHub!

Related Skills

View on GitHub
GitHub Stars31
CategoryDevelopment
Updated18d ago
Forks8

Languages

Dart

Security Score

80/100

Audited on Mar 12, 2026

No findings