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

2015/12/2

Sound Problems

MeeyaHatake MeeyaHatake

2015/12/2

#
I am making a game for a class project. I decided to add a button that plays music, when I click on the button the music starts. I am trying to get it so if the button is clicked on again it will stop the music, but right now it just starts the song again making a cacophony of noise. Any ideas on how to fix this? I had one idea but it just made it so music didn't play at all.
danpost danpost

2015/12/2

#
Maybe you could try using the BGMusic class of my BGMusic Actor Class Demo.
Super_Hippo Super_Hippo

2015/12/2

#
Keep a reference to the music when you create it and stop this music then. Do not create a new GreenfootSound object when you want to stop the other.
You need to login to post a reply.