- A game is created with a boardMatrix
- The game is initialized
- A new Board Object is created
- The board is assigned piece types
- The board is assigned positions
- Board.kings = { positions }
- new Pieces are made
- pieces are assigned properties and legal moves
- Board.positions are assigned a piece.
- Board.set
- Board.setSquares (colors the squares)
- ONCLICK
- If nothing is selected and it's that color's turn, select the sq
- If we click on our piece and a piece is already selected change the selection
- If it's an empty square or opponents piece: // BEFORE MOVING WE DO 16 - 21
- Make sure we're not leaving an active path
- if we're a king, make sure we aren't moving into check
- if we're in check:
- if we're a king, make sure it's one of our escape squares (When are these and the paths reset??)
- if we're not, make sure we're moving into the CORRECT (untested) path.
- if 16, 17, and 18 are ok, check if it's a validMove
- if 16-21 pass, check if we moved the pathholder, and splice it from the pathholders (does this reset if we just move it back???)
- if a pawn reached opps side, promote
-
Notifications
You must be signed in to change notification settings - Fork 0
natecraft1/javascript_chess
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published