Drawing the world map

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By VictorSeven

Hello all!

I would like to replicate the World War Bot in Godot (just for fun, for myself). The algorithm is pretty straightforward, but I got stuck at the drawing part.

As far as I see, WWB uses real data to render the map: where each country is, and what are the borders. That is nice, but I wonder if there is an easier way to it. For example, taking a world map image from Wikimedia and trying to detect each country based in the color it has…

So, what would be the easiest way to implement an interactive map in Godot?

Thank you in advance!

I am no expert in Godot, so someone might have another idea… eventually. What I would do is cut out the countries using a editing program like Gimp, and then use an Area2d node with a polygon2d collision shape and a sprite(with image of a country). This way you can draw accurate collision boxes for the different shapes. Put The “puzzel” of countries toget in one scene, so that it looks like a world map. You can then connect the mouse_entered()/mouse_exited() signals to each Area2d node to detect if the mouse is hovering over a specific node(country). I hope you understand what i am trying to explain.

Coenster | 2019-06-18 14:58