So, I have this advice to play a board game ... The problem is, how do I know which square the user clicked on? I know the x and y coordinates, but how to automate it without having to track the specific locations of each square. (Also, the board size is variable ... so it can have many squares or very small, but the board always has the same height and width, that is, the same number of squares that go from left to right, like the number of squares going from top to bottom).
Thanks a lot for stack overflow :)
dasen source share