MichaelMrt / ChessPHP

Programming Chess in PHP
1 stars 0 forks source link

adding check #77

Closed MichaelMrt closed 5 months ago

MichaelMrt commented 5 months ago

Adding check and checkmate step by step. Adding a method which stores both kings in vars for easier access Adding a method which will look for checks. If a piece can legally move to the kings position he is in check

Also combining both textinput and click logic

MichaelMrt commented 5 months ago

I have removed the method storing the king vars and the king vars themselfes. There is a new method now that just returns the king positions on the given board that you input. This approach allows to input different boards and for example check a future board position. When one side is in check and inputs a move the game now checks if this move would stop check. If it does so, the move is approved, if not the game does not allow you to make this move.