Determining what the mouse is over
Hello, I'm new to the boards and new to game programming, though not new to programming itself (at least in an amatuer capacity). I and my friends are quite the board game fanatics, but often lack the time or sufficient people to play face to face. I have decided to give a go at programming some board games to help alleviate the addiction :)
I think the best idea is to develop a generic library of routines to create generic objects common to all board games as well as an engine to control them and handle input from the user, passing this information along to game specific code. I am hitting my head against a brick wall on how to handle determining what object the mouse is over (for mouse-over info) and where the mouse clicked for either activation or placement.
This kind of thing is trivial for something like chess with only 1 item per "area" and all areas are regular polynomials. But for most board games multiple pieces can be in an area, and most of the time the areas are not regular. I just can't figure out a good method for determining where the mouse was clicked in odd shaped territories. The game of risk is a classic example of this. I know this problem is probably trivial one and easily solved since I've seen computer risk games that are 20+ years old.
Any help in the right directions or links would be much appreciated.
P.S. heh this board group is helping me already just stating the problem and giving the example of chess made me thing of making multiple squares of various sizes that "mostly" fill odd shaped areas (esp since most people won't be clicking on the edge of places to stress test the game ). If this is a common solution ignore this post, if there are better ways I'd be glad to hear them.