Implementing a Risk-style board
- by pouzzler
I have two images of the same dimensions.
One is represents the game board in a user-appealing way, the other represents it in a computer-friendly way where each game area is painted in a unique, uniform color.
When the user clicks the board, we get the click coordinates, find the color of the pixel at the same coordinates in our second image, and that color is directly translatable to a game area, since each area is painted in its own color.
Is that a good implementation? Can you suggest better, if it isn't?
Best regards.