What methods can I use to tell the game that the user has requested it to close with either the GameContainer
or the StateBasedGame
classes.
I have a button and upon it being clicked I want it to close the game, what is the function that needs to be run upon the listener finding out that close was requested?
The GameContainer
class has an exit
method:
public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException
{
if(my_exit_flag)
gc.exit();
// Update code here
}