I am rendering rectangles using this code:
for(int r = 0; r < map.height; r++) {
for(int c = 0; c < map.width; c++) {
if(!map.getTile(c, r).passable) {
gr.fillRect(
(int)(c * GameComponent.tileSize),
(int)(r * GameComponent.tileSize),
GameComponent.tileSize,
GameComponent.tileSize
);
} else {
gr.drawRect(
(int)(c * GameComponent.tileSize),
(int)(r * GameComponent.tileSize),
GameComponent.tileSize,
GameComponent.tileSize
);
}
}
}
For some reason, the edges of the outer filled rectangles render slightly off.
https://dl.dropbox.com/u/41733151/frame.png
I cannot figure out why?
Thanks,
novasharp