I am currently working with the slick2d game engine (been developing in java for a few years, and finally decided to begin working on a independent game). Been having a blast but ran into a small problem tonight: When i render my tiled map unto screen my fps suffers tremendously. I limited the games rendering to the size of the camera on screen and even then it slows down my fps dramatically, can anyone help? Thanks in advance.
Basically this is the code that is causing the problems :
for(int i = 0; i < collisionTileGraphics.size(); i++)
if(collisionTileGraphics.get(i).getX() >= -16 && collisionTileGraphics.get(i).getX() + collisionTileGraphics.get(i).getW()
<= Variables.WIDTH + Variables.TEST_MAP_TILE_WIDTH )
collisionTileGraphics.get(i).render(gc, g);
Where collisionTileGraphics is an arraylist which holds the screens collision layer of graphics.
public void render(GameContainer gc, Graphics g){
image.draw(x,y);
}
where the image is a slick2d Image.