hi,
you can play music in spcified channel so you can mute it, and sound effects in other channel. I tried to mute and didn’t worked so I set volume to 0
Hi Xisco, thanks for the suggestion.
I should have known it would be so simple, this is GDev!
I ended up doing it slightly differently, I just wanted all the sounds either on or off. For those who might be interested, the code I used is below.
I chose the X key and set it up to toggle. Basically the variable is used to check if the sound is on or off, if it’s off turn it on, and vice versa. The timer is needed because key presses are checked very rapidly, and the toggle would happen too quickly to be useful.
I’ve only been using GDev for a short while, so this might not be the best way of doing it, but if anyone wants to use this you’re welcome.