We should not be doing any draw calls for things not on screen (on the camera).
Same goes for the TiledMap, there's actually a function for this too:
public void render(int x, int y, int sx, int sy, int width, int height);
The latter four parameters are the ones it uses to draw.
We will need to pass the GameState's Camera as a parameter so we know the right values here.
Entity should also have a void isOnScreen(Camera camera); function for the same purpose.
We should not be doing any draw calls for things not on screen (on the camera).
Same goes for the TiledMap, there's actually a function for this too: public void render(int x, int y, int sx, int sy, int width, int height); The latter four parameters are the ones it uses to draw.
We will need to pass the GameState's Camera as a parameter so we know the right values here.
Entity should also have a void isOnScreen(Camera camera); function for the same purpose.