I am recreating my previous project https://github.com/GNecro1/TROTMGRO, it was java2D no libs nothing, pure java. Now i am using Slick2D and it is crap. In Java2D i was creating a world 128x128 tiles(300+ FPS), now i am creating (in Slick2D) a world 32x32 tiles (9 FPS). So wtf is wrong?
How I do the rendering:
// Only 1 chunk, rendering
public void render(GameContainer c, StateBasedGame game, Graphics g) throws SlickException {
for (int i = 0; i < tile.length; i++) {
for (int j = 0; j < tile[0].length; j++) {
tile[i][j].render(c, game, g);
}
}
}
// tile rendering
public void render(GameContainer c, StateBasedGame game, Graphics g) throws SlickException {
img.draw(x, y,2);
}
And how i did it in Java2D :
// world
public void render(Graphics2D g) {
for (int i = 0; i < tiles.length; i++) {
for (int j = 0; j < tiles[0].length; j++) {
tiles[i][j].render(g);
}
}
}
//tile
public void render(Graphics2D g) {
g.drawImage(RL.grass, x, y, width, height, null);
}
So anyone care to explain?