Hi, I'm trying to making the sound played depend on the current Level (a sound for each level)
I tried this code:
But the music doesn't change... any idea how to fix that please?
(The BossCounter is reinitialized after each level)
public static GreenfootSound gameMusic = new GreenfootSound("test.AIF");
public void act()
{
ChangeMouseImage(img1, 1, 1);
switch(Level)
{
case 1: gameMusic.playLoop(); break;
case 2:
gameMusic.stop();
if(bossCounter == 10)
{
gameMusic = new GreenfootSound("trytry.wav");
gameMusic.playLoop();
}
break;
}
}
