First, in your render method, you call:
Image a = new Image("blabla"); //create 2 images
Image b = new Image("blabla");
With this, you are creating new Image objects every time that render gets called. So what you'd need to do is create fields to hold your images and initialize them in the init(...)
method. Here's an example:
public class TestGame extends StateBasedGame {
Image a;
Image b;
public void init(GameContainer container, StateBasedGame game)
throws SlickException {
a = new Image("blabla1.png");
b = new Image("blabla2.png");
}
public void update(GameContainer container,
StateBasedGame game,
int delta) throws SlickException {
// Put your update stuff here
}
public void render(GameContainer container,
StateBasedGame game,
Graphics g) throws SlickException {
if (a == 0) {
g.drawImage(a, 0, 0);
} else if (a == 1) {
g.drawImage(b, 0, 100);
}
}
}
Now back to the question, you don't need to worry about 'returning to render' because update and render are kind of like helper methods in an infinite game loop. So what you change in update or render will be seen in either (unless you are changing local variables). Here's a rough pseudo-representation of what the game loop would look like:
while (!gameCloseRequested) {
update();
render();
}
So given that, update and render are continuously called, which means you never have to "jump" from one method to another.