On and Off on the same Button, Help Please Thanks!
kajuto
Member Posts: 314
Hi there everyone and Thanks in Advance!!! i made a main menu which have a option button, play button and instruction button, each time i enter any button is okay except for the option button. WHen i enter Option button and go back to the main menu it turn off the sound...im dunno..help please
Option Button
Rule:
When Touch is pressed
-play sound
-change image
-change scene
Otherwise:
-change image
Sound Button On/Off
Rule:
When Touch is pressed
-change att : Game.SoundOn/Off to (game.soundOn/Off+1)%2
-play sound
Rule:
-Att. Game.SoundOn/Off = 1
-change att: game.Audio.SoundVolume to 1
OTHERWISE:
-change att: game.Audio.SoundVolume to 0
Option Button
Rule:
When Touch is pressed
-play sound
-change image
-change scene
Otherwise:
-change image
Sound Button On/Off
Rule:
When Touch is pressed
-change att : Game.SoundOn/Off to (game.soundOn/Off+1)%2
-play sound
Rule:
-Att. Game.SoundOn/Off = 1
-change att: game.Audio.SoundVolume to 1
OTHERWISE:
-change att: game.Audio.SoundVolume to 0
Comments
@kajuto
Hi Kajuto, if you're using the Audio.SoundVolume, it's turning off all of the sounds, not just one; that's the reason you're having trouble, I think.
This should help; amend your Rules to be like this:
Option Button
Rule: When Touch is pressed
play sound
change image -- to something else
----putting the change scene into touch released will make it less rushed, so------
Rule: When Touch is released -----(or in the Otherwise section of the above Rule)---
change image --- back to original image
change scene
Hope that's what you're after.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
OK, I see now what you're after.... (I really must start reading other people's posts properly... ;-)
I'm still not completely sure why you need to turn off all the sounds but hey, if that's an option in your game, I can't argue!
......although maybe you're after turning off Music, rather than sounds?
Anyhow, as long as your attribute game.soundOnOff is an integer, I can't see why you're having problems...
Maybe rename it without the slash (as I've done above); a small thing, I know but it might have an effect....
Here's one of many tutorials on using modulus for toggling; it's essentially what you already have but it might be of help...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Thanks for the video, btw do you have a web or something like Tshirtbooth?? it helped me out with my project. Thanks A lot! i appreciate it!
Glad I could be of some help. :-) I do have a website (the link for it shows under any one of my posts); it shows my writing and music stuff as well as the apps I've done/involved with.
But as for being like @tshirtbooth 's website....... nooooooo!!! :P I couldn't get anywhere near what TSB's done and achieved with his many excellent tutorials on his site (not to mention the amount of games he's made - but I'll try to catch up to match that one day perhaps....) ;-)
http://gshelper.com/ is totally worth bookmarking in your browser. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
@pan_joshua that true, i love his web. It's helped me a lot really, if you guys know any other web like Tshirtbooth let me know.. thanks a lot
@kajuto No bother; no worries!
Sorry for the delay in getting back to you, we've been away for a couple of days.
If you want some sounds to only play once, make a boolean attribute to act as a switch for each one..
So:
when OptionPlay is false
Play Sound
Change attribute OptionPlay to true
But... I'm still scratching my head to understand why you want these sounds to only play once; surely you want the sound to play every time the user presses the button?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
by chance, is there any other way i can communicate with you more faster? like....skype, facebook, ect...
But having said that, ideally it's best you ask your questions here in the Forums; not only will you get other members' answers as well as mine, the answers given might help others. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps