Skip to content

Commit f3da7e1

Browse files
authored
Merge pull request #360 from purnasth/chess
[feat]: Develop Two-Player Chess Game in Python
2 parents 9884172 + f94abf8 commit f3da7e1

24 files changed

+970
-0
lines changed

Diff for: PYTHON APPS/Chess/Images/Highlight.jpg

107 KB
Loading

Diff for: PYTHON APPS/Chess/Images/PromotionMenu.jpg

106 KB
Loading

Diff for: PYTHON APPS/Chess/Images/bB.png

1.23 KB
Loading

Diff for: PYTHON APPS/Chess/Images/bK.png

2.43 KB
Loading

Diff for: PYTHON APPS/Chess/Images/bN.png

1.48 KB
Loading

Diff for: PYTHON APPS/Chess/Images/bQ.png

2.21 KB
Loading

Diff for: PYTHON APPS/Chess/Images/bR.png

725 Bytes
Loading

Diff for: PYTHON APPS/Chess/Images/bp.png

797 Bytes
Loading

Diff for: PYTHON APPS/Chess/Images/chess.jpg

777 KB
Loading

Diff for: PYTHON APPS/Chess/Images/chess1.jpg

26.2 KB
Loading

Diff for: PYTHON APPS/Chess/Images/dtb.jpg

107 KB
Loading

Diff for: PYTHON APPS/Chess/Images/icon.png

16.1 KB
Loading

Diff for: PYTHON APPS/Chess/Images/logo1.jpg

7.58 KB
Loading

Diff for: PYTHON APPS/Chess/Images/ltb.jpg

8.05 KB
Loading

Diff for: PYTHON APPS/Chess/Images/royal.jpg

22.8 KB
Loading

Diff for: PYTHON APPS/Chess/Images/wB.png

1.9 KB
Loading

Diff for: PYTHON APPS/Chess/Images/wK.png

2.23 KB
Loading

Diff for: PYTHON APPS/Chess/Images/wN.png

1.83 KB
Loading

Diff for: PYTHON APPS/Chess/Images/wQ.png

2.58 KB
Loading

Diff for: PYTHON APPS/Chess/Images/wR.png

933 Bytes
Loading

Diff for: PYTHON APPS/Chess/Images/wp.png

1.26 KB
Loading

Diff for: PYTHON APPS/Chess/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Two Player Chess
2+
3+
This is a simple two-player chess game built in Python. It uses the standard rules of chess and allows two players to play against each other on the same computer.
4+
5+
## Installation
6+
7+
To install and run the game, follow these steps:
8+
9+
1. Clone the repository to your local machine.
10+
2. Navigate to the project directory in your terminal.
11+
3. Install pygame , a Python library for creating games, by running the following command:
12+
13+
```
14+
pip install pygame
15+
```
16+
17+
4. Start the game by running the following command:
18+
19+
```
20+
python main.py
21+
```
22+
23+
## How to Play
24+
25+
The game is played using the standard rules of chess. Each player takes turns moving their pieces on the board until one player is in checkmate or a draw is declared.
26+
27+
To move a piece, select it with your mouse and drag it to the desired square. If the move is legal, the piece will be placed on the new square. If the move is not legal, the piece will return to its original position.
28+
29+
## Features
30+
31+
- `En Passant`: Special pawn capture move inclusion
32+
- `Castling`: Ability to perform the castling maneuver
33+
- `Checkmate and Stalemate Detection`: Logic for detecting game-ending states
34+
- `User Interface`: Graphical representation of the board with mouse controls
35+
- `Standard Chess Rules`: Adherence to traditional chess rules
36+
- `Two-Player Mode`: Enable two human players to compete on the same device
37+
38+
## Code Overview
39+
40+
The game is built using two Python files:
41+
42+
- `engine.py`: This file contains the logic for the chess game, including the rules for moving pieces and checking for checkmate and stalemate.
43+
- `main.py`: This file contains the user interface for the game, including the graphical representation of the board and the mouse controls for moving pieces.
44+
45+
Build with :heart: by [Purna Shrestha](https://github.com/purnasth)

0 commit comments

Comments
 (0)