Volume Control Glitch?

Hello :D
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! :D

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Need more info.

    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

  • jblb2424jblb2424 Member Posts: 65
    edited January 2013
    Thanks for the tip. :) Here are my rules

    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?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2013

    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

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2013
    Here's an even simpler toggle that switches music on/off and swaps images at the same time:

    image
  • jblb2424jblb2424 Member Posts: 65
    I got it to work. I just implemented you guy's rules and it works great. Thanks!
Sign In or Register to comment.