Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fixed animation bug where Rooks would travel across the board when castling.
  • Loading branch information
zachartrand committed Mar 30, 2021
1 parent a9b9d08 commit 116bebb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chess_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
playerClicks = [] # Keep track of player clicks
# (two tuples: [(4, 6), (4, 4)] would be (e2 pawn to) e4)
gs.upside_down = False
humanWhite = False # True if human player is white.
humanWhite = True # True if human player is white.
humanBlack = True # True if human player is black.
if humanBlack and not humanWhite:
gs.upside_down = True
Expand Down Expand Up @@ -415,9 +415,9 @@ def animateMove(move, validMoves, undo=False):
(rookStartFile, rookStartRank) = (
FLIPPEDBOARD[rookStartFile], FLIPPEDBOARD[rookStartRank]
)
(rookEndFile, rookEndRank) = (
FLIPPEDBOARD[rookEndFile], FLIPPEDBOARD[rookEndRank]
)
(rookEndFile, rookEndRank) = (
FLIPPEDBOARD[rookEndFile], FLIPPEDBOARD[rookEndRank]
)
dRookFile = rookEndFile - rookStartFile
dRookRank = rookEndRank - rookStartRank
rookEndSquareColor = rookEndSquare.get_color()
Expand Down

0 comments on commit 116bebb

Please sign in to comment.