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

2013/3/7

Continuous music?

Draymothisk Draymothisk

2013/3/7

#
Is there a way I can get a song to play through level changes? I have multiple worlds, but I don't want the music to be cut off or have to restart in each world. Is there a way to keep it going? Any help would be appreciated. :)
davmac davmac

2013/3/7

#
Music won't stop or restart if you change to a new world.
jennifer56 jennifer56

2013/12/8

#
This might work private boolean firstTime=true; // private boolean start=true; public void act() { // if(start==true) { // Greenfoot.playSound("-----------"); // start=false; }
Adept_Red Adept_Red

2013/12/8

#
Like davmac said. Unless you use stop() or pause() the music will never stop playing, so you won't have to worry about that.
danpost danpost

2013/12/8

#
Adept_Red wrote...
Like davmac said. Unless you use stop() or pause() the music will never stop playing, so you won't have to worry about that.
Also, you will not be able to use 'stop' or 'pause' on the music if started with the Greenfoot 'playSound' method. This is because you do not retain a reference to that particular GreenfootSound object (if one is even created when using that method). To be able to use 'stop' or 'pause' on the music, you would have to create a GreenfootSound object and retain it in an accessible field to use those methods on.
You need to login to post a reply.