Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented castling behavior for black and white #62

Merged
merged 1 commit into from
Apr 22, 2023

Conversation

CapTomAmerica
Copy link
Contributor

@CapTomAmerica CapTomAmerica commented Apr 22, 2023

Edits made to both Util.java and PieceController.java files. Behavior allows players and AI to use both king and queen side castling.
Work includes:

In Util

  • Adding variables to Util class to check for castling viability.
  • Adding option to viable moves if all requirements are met for castling.
  • Castling is initiated by attempting to move the king two spaces in the direction of a legal castle maneuver.

in PieceController

  • Recognizing that either the player or the computer has initiated a legal castling maneuver.
  • Moving the king the proper number of spaces, as well as moving the rook to the opposite adjacent square.
  • Changes are properly reflected on both the board matrix and the GUI

Original Issue link: here

@MrMystery10-del MrMystery10-del merged commit 2eed61c into MrMystery10-del:main Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants