Hi all,
I’m having an issue that I believe is a result of a huge inefficiency in my code. I have a 2D array of tiles in my Map class and I try to render them with the method below.
public void render(Graphics g)
{
for(int row = 0; row < tiles.length; row++)
{
for(int col = 0; col < tiles[0].length; col++)
{
g.drawImage(tiles[row][col].getSprite(), tiles[row][col].getX(), tiles[row][col].getY());
}
}
}
I believe the issue is the fact that I’m rendering a ton of images, but I think I should be using some sort of buffer here. Any suggestions?