I'm going to share it with you guys.
A user clicks on a piece on the chess board (x, y).
The user proceeds to click on a tile (dx, dy).
A vector is created from those 2 points.
A Vectors come out of the piece (0, directionY).
Then find the angle between them.
You see the angle?
It's unique for every chess piece but it works for every chess piece's legal moves.
You know what this means?
I should be shot, because I just re-invented the wheel properly.
A user clicks on a piece on the chess board (x, y).
The user proceeds to click on a tile (dx, dy).
A vector is created from those 2 points.
A Vectors come out of the piece (0, directionY).
Then find the angle between them.
You see the angle?
It's unique for every chess piece but it works for every chess piece's legal moves.
You know what this means?
I should be shot, because I just re-invented the wheel properly.