How do you make/is there any technique for scanning an area

of pixels, for a chess game (there's a rook there, so my knight will cut his stupid head off...)
Also, if you can make a chess game for me, that would also be good
P.S. How do you make it so you can only move into those pixels?
Also, if you can make a chess game for me, that would also be good

P.S. How do you make it so you can only move into those pixels?