Fixed movement on a pieces and user input
parent
5aba3bb6c8
commit
22797be579
|
@ -54,9 +54,10 @@ public class King extends ChessPiece {
|
||||||
|
|
||||||
private void castleRight(){
|
private void castleRight(){
|
||||||
// casting has to move the rook on the right size of the king from white's perspective
|
// casting has to move the rook on the right size of the king from white's perspective
|
||||||
if (this.isWhite) {
|
if (this.isWhite)
|
||||||
b.set(b.size() - 3, 0, b.get(b.size() - 1, 0));
|
b.movePiece(b.size() - 1, 0, b.size() - 3, 0);
|
||||||
} else
|
else
|
||||||
|
b.movePiece(b.size()-1, b.size()-1, b.size()-3, b.size()-1)
|
||||||
b.set(b.size()-3, b.size()-1, b.get(b.size()-1, b.size()-1));
|
b.set(b.size()-3, b.size()-1, b.get(b.size()-1, b.size()-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue