This is a multiplayer chess game developed in JavaScript using Socket.IO for real-time gameplay and chess.js for game logic. Players can compete against each other online, with support for real-time moves, game status updates, and game reset functionality. The game follows standard chess rules, allowing for an engaging user experience.
- Multiplayer Functionality: The game allows two players to play against each other in real-time.
- Real-time Move Updates: Each player's moves are immediately reflected on both sides using Socket.IO.
- Interactive Chessboard: The game features an interactive chessboard where players can drag and drop pieces to make moves.
- Valid Move Detection: Move legality is enforced using
chess.js, ensuring that only valid moves are executed. - Check, Checkmate, and Draw Detection: The game detects check, checkmate, and draw conditions, ending the game appropriately.
- Board Flipping for Black Player: The chessboard is flipped for the player playing as black, offering a more intuitive experience.
- Game Reset: A reset button is available after the game ends, allowing players to start a new match.
- HTML/CSS: For the structure and styling of the chessboard and pieces.
- JavaScript: For game logic, move validation, and piece rendering.
- Socket.IO: For real-time multiplayer functionality, allowing players to compete remotely.
- Chess.js: For chess game rules, move validation, and game state management.
- Tailwind CSS: For responsive design and styling.
- Open the
index.ejsfile in your browser or host the project on a server. - Two players can join the game, and each player will be assigned either the white or black pieces.
- Players can drag and drop pieces on the board to make moves.
- The game will notify players when one side is in check, checkmate, or if the game results in a draw.
- After the game ends, players can reset the board to start a new match.
- Clone the repository:
git clone https://github.com/AD9190/Chess
- Navigate to the project directory:
cd chess-game - Install the required dependencies:
npm install
- Start the server:
node server.js
- Open your browser and navigate to
http://localhost:3000to start playing.
- Add AI to allow for single-player mode.
- Implement player authentication and lobby systems.
- Add a timer for competitive matches.
- Improve game animations and visual feedback for better user experience.