Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shohih

An online multiplayer chess game with GUI written in C++ with support for both Offline and Online modes.

How to build

Install the dependencies for GLFW:

sudo apt install libwayland-dev libxkbcommon-dev xorg-dev

Clone the repository and third-party libraries:

git clone --recurse-submodules https://github.com/vaezim/Shohih.git && cd Shohih/

Build the main program only (excluding tests)

./build.sh
cd ./output/exe
./shohih_main  # main executable

Build the main program and tests

./build.sh --test
cd ./output/exe
./test         # test executable
./shohih_main  # main executable

Build in debug mode

./build.sh --debug

Playing in Online/Offline modes

Shohih supports both offline and online game modes. To see the usage guide execute ./shohih_main

Usage: ./shohih_main [OPTIONS]
Options:
-m, --mode	Select game mode (online|offline)
-u, --host	Set server address in online mode
Example: ./shohih_main --mode offline
Example: ./shohih_main -m online --host 10.12.24.36
NOTE: Server address can be ip address or url
NOTE: Server is listening on port 8080

Online mode

  • On the computer hosting the server:
cd ./output/exe
./shohih_server
  • Players' computer (can be the same as the server's computer):
cd ./output/exe
./shohih_main --mode online --host <server_address>
./shohih_main --mode online --host localhost  # If client and server are on the same computer

Offline mode

cd ./output/exe
./shohih_main --mode offline

Demo videos

Online mode

shohih_online.mp4

Offline mode

shohih.mp4

TODO

  • Implement and test GetAvailableMoves() function for all pieces
    • Pawn (Including En-Passant)
      • In case of En-Passant, remove the other pawn from the board
      • Pawn promotion
    • Knight
    • Bishop
    • Rook
    • Queen
    • King
  • Implement board class
    • Add turns (black should not play in white's turn)
    • Support giving checks and checkmate
    • Pieces cannot take kings.
    • Add full support for FEN notation (Including player turn)
    • Support castling
  • Implement Game manager
  • GUI with Raylib
    • Board texture
    • Piece texture
    • Show available moves when clicking on a piece
    • Update piece texture position with piece objects
    • King square turning red if in check
    • If a piece can be taken, change square corner shapes instead of a circle
    • Add menu to select Online/Offline mode and enter server address
  • Update demo video after fixing bugs
  • Implement online mode
    • Add /exit http request
    • Improve connection speed (replace Http with Websocket?)

About

An online multiplayer chess game with GUI

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages