i added music into my world class and when the world is running, the music plays but i want the music to stop when my player dies. how can i do this?
GreenfootSound sound = new GreenfootSound("soundFileName.wav");
sound.play();
// later
sound.pause();
// or
sound.stop();private GreenfootSound music = new GreenfootSound("Music.mp3");
public void started()
{
music.play();
if(getObjects(Ship.class).isEmpty())
{
music.stop()
}
}