Hello, I am trying to add a play button and when I click on it it starts playing, and then when I click on it again it pauses and a pause button shows up. But I'm not sure what is wrong with my code. Thoughts?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if (Greenfoot.mouseClicked( this )) { mySound.play(); } else { if (mySound.isPlaying()) { if (Greenfoot.mouseClicked( this )) { mySound.pause(); setImage( "Pause.png" ); } } } |