I've been working on a game in Java and I'm having an issue with the blocks which the player can place down in the game. I have specific types of blocks which are meant to be for decoration. They're basically walls. The player can walk through them - no interactions are made between them.
The problem is, the only way I can do that is to draw the walls before I draw the interactive/solid blocks. That means I'd need to have 2 for loops in my render method - one to iterate over my block storage list and ONLY look for walls, and the other one to render the rest of the solid ones.
This causes about a decrease of about 200-250 fps. Is there another way I can go about rendering the walls behind the player/everything else?
By the way - I'm not using any libraries, and I'd really honestly rather not.
Thank you.