hi there construct2 community!
My 1st game is nearing completion and I began to add sounds and music into it.
So far so good, but I've ran into an issue with a toggable on/off button for sounds and music
I tried the following solution:
2 Local Values (WebStorage.LocalValue("xxx"), both wit 0 (sounds/music off) and 1 (sounds/music on).
If the player clicks on the "XXX off/on" button the sound/music localValue is changed to 0 or 1, depending on what it was before.
It will look like this:
(ignore the "MusicOnOff/SoundOnOff" is visible/invisible part, this is only a button-was-pressed feedback for the player and works as intended)
next step is to let music/sounds only play when LocalValue=1, this is rather easy and works.
My problem is: Both Local Values don't change on button pressed! They go from 1 -> 0, but not back to 1 if I press again. Even after switching the layout or restarting the run/debug layout the values won't change on button clicked.
I've tried different things allready, but none works :(
Help would be much appreciated!
greetings
batzu
//edit1: if I switch the order of the Local Key "SoundOn" = 0 and Local Key "SoundOn" = 1, and same for Music, it changes from 0->1 but not back.
I assume if I press the "SoundOnOff" button it runs through all of the sub-conditions, so first it will change form 0 to 1 and then immediately back from 1 to 0 or vice versa, depending on which condition comes first, because the 2nd condition immediately is true ._.
So what I need is a way to "check" what value the local key has.. I thought the way I did it worked