Hi everyone,
I am currently writing a RISK like strategy game. The game mechanics work nicely, but unfortunately the graphics are very slow.
The World map consists of lots of two-dimensional polygons, that can have three or more vertices. Each polygon represents a sector.
I am using Graphics2D. First, all polygons are drawn using fillPolygon in a color that represents the nation that owns the sector.
To make the game look a bit nicer, i use a 12 pixel wide Stroke and draw the Polygon in a translucent black. this time with drawPolygon. Next, i set the stroke back to 1 and the color to a solid black and draw the polygon again with drawPolygon, to show the borders.
There is more to it, but this part of the code is, what slows the game down.
I helped myself by buffering the worldmap in a BufferedImage and only redrawing it when the world map changes. But as soon as a sector gets conquered, the world map has to be redrawn and the game slows down.
Do you have any suggestions, how to improve performance?
Sorry for my bad english.