Hi all,
I would like to develop small turn based game with slick2d but I cannot imagine a way how to do it in slick2d update() method. It is quite easy to develop own game loop for turn based game but how to do it in slick2d with its update/render methods? Any idea how to tell update() method to wait until something happens (keypress or player action taken)?
I have tried something like:
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
boolean played = false;
while (played == false) {
Input input = container.getInput();
if (input.isKeyDown(Input.KEY_RIGHT)) {
container.resume();
x = x + 32;
played = true;
}
}
}
But window got unresponsive and input never received my keypress.
I am quite new to slick2d so maybe it is just some misunderstanding of the basic library concepts on my end (very probably). Thank you.