Systemcluster/TheImpossibleCloneJava2D — pull request #5 by lazy-senior (2013-11-08 08:14:42+00:00)
Title: Sound

Add
private String pathJumpSound = "res/Jump.wav";
private AudioSource asJump;

public Player(){[...]
try {
asJump = (AudioSource) ResourceLoader.load(pathJumpSound);
if(!asJump.isOpen())
asJump.open();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (LineUnavailableException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}[...]
}
asJump.start() starts playing the sound