Hello all,
I’m creating a game (in an applet) that uses tilemaps, so I have a very large image that contains all the tiles I will be using. I created a custom file format for my tilesheet because it’s able to compress the file more then a png file. Now I’m having trouble loading in the images (I did a lot of searching before posting, but I’m quite new to java and I couldn’t find a good solution).
How would I handle the image files? I was thinking about creating a seperate class that will hold all the images, and load them one by one in a seperate thread, would this work good? Also should I convert the big image into alot of smaller ones for each tile, or rather keep the big image and draw it partially using drawImage?
And how should I load the image? All I could think of was loading the entire file into a byte array, then convert the data to an ARGB Int array, and convert that array to an Image, this looks very inefficent though.
Thanks in advance