Hello everyone. I’m working on a tile-based game, but it is running extremely slowly. I’m hoping you all can help me out with speeding it up.
Right now, the background is made up of dozens of invididual tile images that are read from a file. I create a BufferedImage called background and then draw all the tiles onto the BufferedImage using g.drawImage. Since the background never changes after it is first created, I then just draw the background onto the screen whenever it updates.
However, I found the program ran faster if I drew the individual tiles to the screen for each update rather than the background BufferedImage. I’m assuming I did something wrong, because it doesn’t make sense that a lot of small images would be drawn faster than one big image.
Is there a problem with the way I created the background BufferedImage? I appreciate any help anyone can give.