Open olufjen opened 3 years ago
After castling, the King's position is still e1, according to the rook's position list Both King and Rook remain in their original positions after castling, according to all other friendly pieces. This is so because calculations for possible moves and available positions are done before the next move by the player.
Solved bug in the checkCastling method of the chessAction object
For White rook 1: piece: Piece position a1 X, Y (0, 0) wR a1 ROOK ActiveName R Available positions Position: h1 W X, Y (7, 0) Position: g1 B X, Y (6, 0) Occupied by: WhiteKing Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: e1 B X, Y (4, 0) Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: c1 B X, Y (2, 0) Occupied by: WhiteBishop1 Position: b1 W X, Y (1, 0) Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1 Position: a3 B X, Y (0, 2) Position: a4 W X, Y (0, 3) Position: a5 B X, Y (0, 4) Position: a6 W X, Y (0, 5) Position: a7 B X, Y (0, 6) Occupied by: BlackPawn1 Position: a8 W X, Y (0, 7) Occupied by: BlackRook1 Removed positions Position: g1 B X, Y (6, 0) Occupied by: WhiteKing Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: c1 B X, Y (2, 0) Occupied by: WhiteBishop1 Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: a2 W X, Y (0, 1) Occupied by: WhitePawn1 Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: f1 W X, Y (5, 0) Occupied by: WhiteRook2 Position: d1 W X, Y (3, 0) Occupied by: WhiteQueen Position: e1 B X, Y (4, 0) ...