This is a very simple implementation of the classic "Chess" game.
It is written in JavaScript and uses the HTML5 canvas for rendering.
- Drag and drop functionality to move pieces instead of using onclick events.
- Automatic detection of valid moves.
- Automatic detection of when a player is in check.
- Automatic detection of when a player has won.
- Automatic detection of a draw by stalemate.
Just open the index.html
file in your browser.
The games logic is implemented in the game.js
file.
This file includes the initialization of the game board, the logic for moving and capturing pieces, and the logic for determining when a player has won.
The BuildBoard
function is used to draw the board on the canvas.
The drag
, allowDrop
, and drop
functions are used to implement the drag and drop functionality.
The checkWin
function is used to determine when a player has won.
- Add multiplayer online functionality.
- Add an AI to play against.
- Add a scoring system.
- Improve the UI.
- Add options to save and load games.
- Add move history and undo functionality.
- Add animations for moving pieces.
- Add sound effects.
- Add a timer for each player's turn.
- Add a tutorial for new players.
- Add a points system for each piece.
Feel free to contribute to this project.
Please open an issue if you have any suggestions or find any bugs.
This project is licensed under the MIT License - see the LICENSE file for details.