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

2016/6/7

How to stop background music when moving to a different World.

KrystalLo KrystalLo

2016/6/7

#
How do I stop the background music from myWorld when it moves to the Gameover world?
danpost danpost

2016/6/8

#
Stop it when (just before) you set the new Gameover world active.
KrystalLo KrystalLo

2016/6/8

#
And how would I do that? backgroundMusic.stop(); ??? Since when the pirate loses all his lives it immediately goes to the gameover world. And when the myWorld starts the background music starts and begins to loop whenever the song finishes.
danpost danpost

2016/6/8

#
KrystalLo wrote...
And how would I do that? backgroundMusic.stop(); ??? Since when the pirate loses all his lives it immediately goes to the gameover world. And when the myWorld starts the background music starts and begins to loop whenever the song finishes.
((MyWorld)getWorld()).backgroundMusic.stop();
Greenfoot.setWorld(g);
You need to login to post a reply.