2019.04.15 Modified sound toggle options


Modified sound toggle options

Previously, I checked if sfx variable and music variable are true in global option

If it is true, it executes the play function of the audio node of the scene

But this way, I get more code, more conditionals, and less readability.

So I decided to unconditionally play without checking the bool variable

And I came up with an idea to modify the volume of the sound

We have just used the godot engine and have looked for audio volume data

https://godotengine.org/qa/24377/change-global-volume-in-3-0

I found this post and I immediately added an audio bus

Check once when the game is first turned on

Then check again in the sound options scene on the main screen

So when the game ends and you come back to the main screen, the changed sound options will be applied

And the toggle system using the volume of the audio bus was completed

Now I'm going to find the appropriate bgm and sfx to get into the game.

Leave a comment

Log in with itch.io to leave a comment.