GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

mute button for all the scenes instead of one scene.

famekraftsfamekrafts Posts: 834Member, BASIC
edited October 2012 in Working with GS (PC)
This is one of the my major headaches.

Now I got a main music file which plays throughout the game.

If I change scene, the music restarts, so I put pause at the time when it changes scene and unpause when it enters new scene.

The problem is Now I need to create a mute button which should work on all the scenes.

for example if I pause music in one scene it should remain paused in the other scene as well. But that doesnt work because the new scene has controller which unpauses music.

So created an attribute pause music and put it to pause.

When I click on the sound button, it changes attribute to true, when it is true the sound should stop. It should also change its image to the mute button.

But my logic is not working.

i have written

if touch is pressed and pause music is false, change pause music to true.

and if its is true, change it to false.

But what is happening is when I touch, it turns into true then instantly into false again, so there is no change, button doesn't change image or pauses music.

can anyone help with a demo or suggestion?







Comments

  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    just turn the volume off. You should not need to use pause and unease though. If you just start the music in your intro screen and never change it again it will just play forever. Then you can control it all with the music volume attribute. Either way though turning the volume down will shut it off until you turn it back up.

    Cheers

    It's not my fault I never learned to take responsibility for anything. ;)

  • famekraftsfamekrafts Posts: 834Member, BASIC
    Will give this a try, thanks.
  • tenrdrmertenrdrmer Posts: 9,934Member, Sous Chef, Senior Sous-Chef
    also check out this video for a super simple on/off button

    It's not my fault I never learned to take responsibility for anything. ;)

  • famekraftsfamekrafts Posts: 834Member, BASIC
    Thanks man your first solution worked, will check out the video.
This discussion has been closed.