Can someone tell me how to shorten a music file. When my cat stops dancing in the FatCat scenario, I want the music to stop also. Thank you in advance.


1 2 3 4 5 | // instance field (in Cat class -- I would guess) private GreenfootSound music = new GreenfootSound( "whatever.mp3" ); // in act or method it calls if ( /** cat starts dancing */ ) music.play(); if ( /** cat stops dancing */ ) music.stop(); |
1 | public void act() |
1 | public act() |