leosiden wrote:
Alright so I've been trying to make music stop when you enter another state. Here's what I tried first:
Code:
if(input.isKeyDown(Input.KEY_ENTER)){
mus.stop();
sbg.enterState(1);
}
But when I hit enter the game crashed. No errors it just closed down. Then I used google to find another way to stop music with Slick and here's what I found:
Code:
public void stop()
So I tried this:
Code:
if(input.isKeyDown(Input.KEY_ENTER)){
public void stop(mus);
sbg.enterState(1);
}
But Eclipse gave me an error saying "void is an invalid type for the variable stop"
What do I do? Is it possible to stop music from another .java file/game state? If so, how?
No errors... That's a little fishy. Are you sure you aren't exiting the JVM somewhere else? And are you sure the console is empty? Slick will report any errors if there was a problem.
I think you need to start smaller -- your second bit of code leads me to believe you have no idea what you're doing.

You need to know how to use Java in order to use Slick. I'd suggest you read some books and take a course before you attempt rendering graphics or making a game.