Volume Control Glitch?
jblb2424
Member Posts: 65
Hello
In my game i have a simple volume control. I have a check box that, when a check in the box is present, that means volume is on. When there is no check, volume is off. The game starts out with volume on, so the checks start out in the boxes. This almost works, except i have one glitch. Lets say when i go into options i have my volume on. When i turn volume off and the check goes away, the volume goes off and i continue to play my game with no volume as it should. However, when i return to the options menu, volume is still off but the check resets back into the check box, which it shouldn't be.
So whats happening is that every time i return to the options menu, the check reset back into the check boxes, regardless if the volume is on or off. How can i correct this? If you need more info feel free to drop a comment. Thanks!
In my game i have a simple volume control. I have a check box that, when a check in the box is present, that means volume is on. When there is no check, volume is off. The game starts out with volume on, so the checks start out in the boxes. This almost works, except i have one glitch. Lets say when i go into options i have my volume on. When i turn volume off and the check goes away, the volume goes off and i continue to play my game with no volume as it should. However, when i return to the options menu, volume is still off but the check resets back into the check box, which it shouldn't be.
So whats happening is that every time i return to the options menu, the check reset back into the check boxes, regardless if the volume is on or off. How can i correct this? If you need more info feel free to drop a comment. Thanks!
Comments
When you post a problem you're having, it's very helpful to include your rules.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I have an integer attribute game.mute. When it is 0, the game is not muted. When it is 1, the came is muted.
{Check:} When touch is pressed and game.mute=0....change game.mute to 1 and change x and y positions to -100(When the check is pressed, the volume becomes muted and the check moves off the screen and out of the check box) When game.mute=0, change x and y positions to (331,202), inside the checkbox.
{Check Box} When touch is pressed and game.mute=1...change game.mute to 0.
Any suggestions anyone?
Hi @jblb2424 As this is a simple type of toggling, it'll work best if everything is in one rule:
Rule: When touch is pressed
Rule: ---nested in above-- When game.Audio.Music.Volume = 0
Change attribute tick.position.x to -100
----no need to change the y coordinate
Change attribute When game.Audio.Music.Volume to 1
Otherwise
Change attribute tick.position.x to 331
Change attribute game.Audio.Music.Volume to 0
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps