Created a canCheck method to see if a piece can check the king