Skip to content

loc-ne/chess-game-oop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

457 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Game OOP

A modern, object-oriented chess game built with C++ and SFML, featuring a clean UI, multiple game modes, and an extensible architecture.

Features

  • Local Play: Play chess against another player on the same device.
  • AI Opponent: Challenge a computer opponent with adjustable difficulty.
  • Replay & History: View and replay previous games with move-by-move navigation.
  • Time Controls: Support for chess clocks and custom time settings.
  • Modern UI: Responsive, visually appealing interface using SFML.
  • Extensible Design: Easily add new features, states, or UI components.

Software Architecture & Design Patterns

  • Object-Oriented Programming (OOP): Clear separation of concerns (controllers, views, models), encapsulation, and inheritance.
  • MVC Pattern: Model-View-Controller for maintainability and scalability.
  • State Pattern: Manage game states (main menu, local game, AI game, replay, etc.) for easy transitions and extensibility.
  • Singleton Pattern: Managers like TextureManager ensure a single instance throughout the application.
  • Factory Pattern: State creation and management through flexible instantiation.
  • Resource Management: Smart pointers (std::shared_ptr, std::unique_ptr) for safe and efficient memory management.
  • Event-Driven Programming: Real-time response to user and system events.

Programming Skills Demonstrated

  • Advanced C++ (OOP, smart pointers, STL, RAII)
  • UI programming with SFML (graphics, window, event handling)
  • Modular code organization and separation of concerns
  • Error handling and resource cleanup
  • Cross-platform considerations (Windows API for workspace size, SFML for portability)
  • Documentation and code comments for maintainability

Requirements

  • Compiler: g++ 13.1.0 (MinGW-W64)
  • Graphics library: SFML 2.6.2
  • Download link: https://www.sfml-dev.org/download/sfml/2.6.2 select GCC version 13.1.0 MinGW (SEH) - 64-bit
  • After successful download, copy the include and lib folders to the same level as the source folder
  • Copy all .dll files in the bin folder to the release folder so that the executable file can run without missing library errors
  • Download the stockfish engine at https://stockfishchess.org/ and place the engine's exe file in the folder containing the game's exe file if playing with AI

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/ChessGameOOP.git
    cd ChessGameOOP
  2. Build the project:
    • Using Makefile:
      make
    • Or with CMake:
      mkdir build
      cd build
      cmake ..
      make

Usage

  1. Run the compiled executable.
  2. Choose your game mode (Local, AI, Replay, etc.).
  3. Use the UI to interact with the chessboard, controls, and settings.

Demo

Demo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors