I invented a game but I need help

Should be in a format of x, y coordinates which will render a country.

Reason?
Bored, so I invented a board game that allows you to play against a computer.
The aim of the game is to conquer the world using armies and invading other countries.

I have all the groundwork laid out.
My only issue is that I can’t draw for shit.
I’ve even created my own editor.

If I can get a bunch of coordinates which make up these countries so far:
America, Iran and Australia.

I can create my own loaders and the like so that isn’t an issue.

Thanks.

I poked around Google, and came up with a good map to use as a mask for creating your own:

http://history.acusd.edu/cdr2/WW2Pics2/82035bg.jpg

I have no idea if the image has a copyright or not, but I doubt they’d mind too much if you created an entirely new map from it. :slight_smile:

Sorry but how am I going to get that into thousands of coords?

I need a file that contains coordinates which creates a country.

x, y
x, y
x, y
x, y
etc…

I should load it up and place those values into a Polygon object in Java and it should render the country.

[quote]Sorry but how am I going to get that into thousands of coords?
[/quote]
You’re not. You’re going to open your favorite graphics program, and get the coordinates by drawing a polygon around each country. It doesn’t matter if you’re 100% precise or not. Just make sure you’re close. Once you have a set of polygon coordinates, then you can find the internal volume of that polygon.

Alternatively, you can flood fill the poly in your paint program, and read the color in at runtime.

Ahhh. Thanks.

Where can I find more info in the second option? It sounds quicker.

Both options are probably about the same amount of work. But if you’re more comfortable with the later, all you need to do is fill each territory with a unique color. As runtime, you just load the BufferedImage and read the individual RGB values. e.g.:


String[] countries = {"America", "European Union", "K.I.L.E.R's Island of DOOOOOM"};
int[] colors = {0x00FF00, 0x0000FF, 0xFF0000};

BufferedImage map = ImageIO.read(getClass().getResource("/map.png"));

public void mouseClicked(MouseEvent evt)
{
  int color = map.getRGB(evt.getX(), evt.getY());

  for(int i=0; i<colors.length; i++)
  {
    if(colors[i] == color) System.out.println("You selected the country of "+countries[i]);
  }
}

That’s it?
That’s pretty easy. :slight_smile:

My only problem is that in the end my image would be a rectanlge and not a polygon.

Or am I wrong?

[quote]That’s it?
That’s pretty easy. :slight_smile:
[/quote]
Never claimed otherwise. :slight_smile:

[quote]My only problem is that in the end my image would be a rectanlge and not a polygon.

Or am I wrong?
[/quote]
??? I don’t understand the problem. The image will be a rectangle, but your countries should be flood filled polygons within the image. If you don’t want the image to seem rectangular, then just make the non-land areas transparent.

With the image I linked to, it should be very easy to do. Just draw some black lines to separate the countries. Once they’re separated, you can use the Magic Wand tool to select the correct area. Then pick your color for that country and use the Flood Fill tool to color it. Easy, peasy. :slight_smile:

The alternative is to use a selection draw tool to trace a rough approximation around the area. Once you close the drawing (and it doesn’t need to be precise!), you’ll have a completely selected country.

[quote]I poked around Google, and came up with a good map to use as a mask for creating your own:
[/quote]
Alternatively, you could download free GIS shape files for country shape data. This would give you much more accurate polygons. The shape file format is pretty simple to parse, but if you don’t want to write your own parser, OpenMap (http://openmap.bbn.com/) is free, and includes one.

God bless,
-Toby Reyelts

Britain is sooooo much bigger than that :smiley:

[quote]Britain is sooooo much bigger than that :smiley:
[/quote]
No, looks about right. Britain just seems bigger when you’re on the ground. :slight_smile:

Even worse!
The arrow lines from Greece and Yugo-Slavia CROSS!!!
Thats something you learn not to do in highschool drafting classes, even back in the '30s.

I feel ill :frowning: