https://github.com/karanbravo/chess_game
In this I have created Chess Game using pygame.
https://github.com/karanbravo/chess_game
chess chessboard multiplayer nodejs python socket-io socketio typescript
Last synced: 3 months ago
JSON representation
In this I have created Chess Game using pygame.
- Host: GitHub
- URL: https://github.com/karanbravo/chess_game
- Owner: karanBRAVO
- Created: 2022-10-03T10:33:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T18:04:22.000Z (over 1 year ago)
- Last Synced: 2025-12-31T11:27:48.988Z (6 months ago)
- Topics: chess, chessboard, multiplayer, nodejs, python, socket-io, socketio, typescript
- Language: Python
- Homepage: https://chess-server-tbiv.onrender.com/health
- Size: 327 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chess_Game v2
- Create a chess game from `0 -> END` `#multiplayer`
- Using: `Pygame`, `Python`, `Node.js`, `Socket.io`
**_`note`_**: make sure you have installed the `colorama` library before running the script.
- to install the `colorama` library
```bash
pip install colorama
```
- all the assets are provided in the `chessAssets` directory
## Usage
- clone the repository
```bash
git clone https://github.com/karanBRAVO/Chess_Game.git
```
- move to the cloned directory
```bash
cd Chess_Game
```
- move to the chess server directory
```bash
cd chessServer
```
- install the dependencies and run the build command
```bash
npm install && npm run build
```
- start the server
```bash
npm run start
```
- run the game script `(you have to run multiple terminals and run below command from the root dir)`
```bash
chmod +x main.sh && ./main.sh
```
## Preview of the Game

## File Structure
chessAssets/
|
chessEngine/
|-- assets/
| |-- army/
| |-- chessboard.py
| |-- logger.py
| |-- pieces.py
|-- main.py
|
chessServer/
## Virtual Environment Setup (recommended)
1. Install the `python3-venv`
```bash
sudo apt install python3-venv
```
2. Create the virtual env.
```bash
python3 -m venv myenv
```
3. Activate the env.
```bash
source myenv/bin/activate
```
**note**: to deactivate type _`deactivate`_ in terminal
## Create the desktop application
1. install the module
```bash
pip install pyinstaller
```
2. run the command
```bash
pyinstaller --onefile --icon=chessEngine/icon.ico --add-data "chessAssets;chessAssets" --hidden-import socketio --hidden-import colorama --name=chess chessEngine/main.py
```
3. run the final output
```
./dist/chess
```
### Note
To fix the path issue while creating the `.exe` file
```python
import os
import sys
def resource_path(relative_path):
""" Get the absolute path to a resource, works for development and PyInstaller bundling """
base_path = getattr(sys, '_MEIPASS', os.path.abspath("."))
return os.path.join(base_path, relative_path)
# pygame.image.load(resource_path("chessAssets/rook.png"))
```
### ©️ Karan Yadav 2023