Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Turning Music off/on?

Author
Message
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 25th Sep 2008 01:17 Edited at: 25th Sep 2008 03:53
So I'm implementing an option to turn the music off in the game I'm currently developing. I just can't seem to get it to work right. I know its probably a stupid error I just can't see, but if you could help me out I'd greatly appreciate it.



The music starts on and I have it so I can turn it off, but then I can't turn it back on.
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 25th Sep 2008 02:56
You're setting canclick to 0 which makes it impossible to click again. Remove canclick completely, and it will work.

Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 25th Sep 2008 03:49 Edited at: 25th Sep 2008 03:52
No I'm setting it back to 1 but it's just not there. But I'll try taking it out.

But what I think will happen is it will just keep starting and stopping the music rapidly.

EDIT: Ok I took the canclick variable out and it doesn't keep playing the music rapidly. However it will still only turn the music off and not back on.
Swift
16
Years of Service
User Offline
Joined: 17th Aug 2008
Location:
Posted: 3rd Oct 2008 16:43
make the 4th if statement an else if.the reason it wont turn back on is because. it checks if it is off and then it turns is on. but straight after it turns back on it checks to see if its on and then turns it straight back off again. just think the scenario through it makes sense.

Login to post a reply

Server time is: 2024-09-30 07:32:19
Your offset time is: 2024-09-30 07:32:19