TKPending / ChessGame

HTML and Javascript Chess Game
0 stars 0 forks source link

CG-24 Restrict king movement #36

Closed TKPending closed 9 months ago

TKPending commented 9 months ago

There are two movements that the king currently can do, which the king can't do.

Castling: One of the rules with castling is that the king can't jump over a tile which is being attacked by the enemy.

Check/Checkmate: The king can't capture a piece, which is in a tile that is being attacked by another piece. As this will put the king into check again.

I need to restrict these movements, so that the king is unable to make these moves.