Hi, is there a recommended solution for getting the stickman to float when he hears a noise. I have done some searching on the internet, and some of the solutions look very complex. Thanks in advance.


1 2 3 4 5 6 | public static GreenfootSound[] sounds = { new GreenfootSound( "bump.wav" ), new GreenfootSound( "aw.wav" ), new GreenfootSound( "victory.wav" ) }; |
1 | MyWorld.sounds[ 0 ].play(); // plays 'bump.wav' |
1 | if (MyWorld.sounds[ 2 ].isPlaying()) // checks if 'victory.wav' is playing |