I'm trying to get the distance between two geoms but I'm having some accuracy problems.
What I do is, I loop all nodes in GEOM A and GEOM B and then get the closest nodes to each other and use the distance between them to get the over all closest distance. The problem with this is, if I have two polygons that are not 100% lined up, like this:
The distance is not "0" but its the separation they have by X (not Y).
I need to be able to get the distance for enemy AIs. My enemies have set of weapons that are effective for a specific range (ie. Arrows = range 10, Beams = range 100, ect.) So the enemy needs to know the distance between itself and its target accurately
so it knows what weapon to use. Some weapons like "Beams" do not need the enemy and the target to be 100% or even 50% aligned. The game is pixel based an not square based, which complicates the problem even more.
Any ideas how I can get the distance between two geoms accurately?