Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

When I write this statment throws a SlickException. I got an error and this is the message: required Throwable found SlickException. This my code :

public void initStatesList(GameContainer gc) throws SlickException{
    this.getState(menu).init(gc, this);
     this.getState(menu).init(gc, this);
     this.enterState(menu);  
}
share|improve this question

1 Answer 1

The initStateList method is there for you to add states, not initialize them. Slick will initialize them for you and enter the first state you added automatically.

It should look like this:

public void initStatesList(GameContainer gc) throws SlickException {
    addState(new YourFirstState();
    addState(new YourSecondState();
    ...
    }

Then slick will automatically initialize them and enter "YourFirstState"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.