I need again help in my game, i need a background sound.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | /** ***** in MyWorld ***** */ public static GreenfootSound bgSound = new GreenfootSound( /** arg */ ); public void started() { bgSound.playLoop(); } public void stopped() { bgSound.pause(); } /** ***** in Player class ***** */ // at end of act (assuming player is removed from world when it dies) if ( this .getWorld() == null ) { MyWorld.bgSound.stop(); } |