This site requires JavaScript, please enable it in your browser!
Greenfoot back
Parte
Parte wrote ...

2016/9/27

Randomly playing background music and resetting the position of world objects

1
2
Parte Parte

2016/9/29

#
danpost wrote...
I guess I forgot to start the music after setting the 'bgm' field in the 'play' method. Modify the method to this:
public static void play()
{
    if (bgm == null || !bgm.isPlaying())
    {
        bgm = new GreenfootSound(soundFiles[Greenfoot.getRandomNumber(soundFiles.length)]);
        bgm.play();
    }
}
Thanks a lot!
You need to login to post a reply.
1
2