I am trying to render a background image in my Slick2d window. However, it’s not rendering. What’s wrong?
This is the first part of my main class
public class SimpleGame extends BasicGame{
Image land = null;
public SimpleGame()
{
super("Slick2DPath2Glory - SimpleGame");
}
@Override
public void init(GameContainer gc) throws SlickException {
land = new Image("bg.jpg");
land.draw(0,0);
}
Here’s the root tree
http://billedeupload.dk/images/4J5CQ.png
You should do all the rendering in the render() method instead of the init() method. So something like this: