I have a project I’m working on using Slick2D. Now, I have a enum for my Tiles, nothing too fancy, it simply has what image the tiles should use and the scale. I then have another class to generate chunks. This class will store the data in a 2D Tile array which I had no problem rendering and moving about. Now to the tricky part, I have a world class that I am using to store entities in an ArrayList and then a 2D Chunk array. Now, in my game state I initialize the world and fill it with chunks, my question is how would I go about rendering the tiles?
When rendering a chunk by itself without the world, I have a getTileImage method that grabs the tile image based on the pixel on the screen, my problem is now I have to figure out what chunk the pixel is in and then also figure out the tile within that chunk. I’m not exactly sure if this is the best way to go about this so if you have a recommendation I will gladly listen. Also, if you need any of my code let me know, I am still relatively new to Java so it might not be pretty.
Thanks!