mirror of
https://github.com/RYGhub/the-cold-night.git
synced 2024-11-22 04:34:19 +00:00
🔧 Mute music below a certain threshold
This commit is contained in:
parent
be3d7a9afc
commit
f8ea6ebf0d
4 changed files with 21 additions and 4 deletions
|
@ -13,6 +13,10 @@ config_version=4
|
|||
config/name="LD50"
|
||||
run/main_scene="res://src/levels/Game.tscn"
|
||||
|
||||
[audio]
|
||||
|
||||
default_bus_layout="res://src/default_bus_layout.tres"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=1280
|
||||
|
|
9
src/default_bus_layout.tres
Normal file
9
src/default_bus_layout.tres
Normal file
|
@ -0,0 +1,9 @@
|
|||
[gd_resource type="AudioBusLayout" format=2]
|
||||
|
||||
[resource]
|
||||
bus/1/name = "Mute"
|
||||
bus/1/solo = false
|
||||
bus/1/mute = true
|
||||
bus/1/bypass_fx = false
|
||||
bus/1/volume_db = -80.0
|
||||
bus/1/send = "Master"
|
|
@ -24,17 +24,17 @@ fire_path = NodePath("../PhaseOneContainer/Fire")
|
|||
|
||||
[node name="Bell" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"]
|
||||
stream = ExtResource( 10 )
|
||||
volume_db = -60.0
|
||||
volume_db = -80.0
|
||||
autoplay = true
|
||||
|
||||
[node name="Choir" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"]
|
||||
stream = ExtResource( 8 )
|
||||
volume_db = -60.0
|
||||
volume_db = -80.0
|
||||
autoplay = true
|
||||
|
||||
[node name="Drum" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"]
|
||||
stream = ExtResource( 9 )
|
||||
volume_db = -60.0
|
||||
volume_db = -80.0
|
||||
autoplay = true
|
||||
|
||||
[node name="PhaseOneContainer" type="Node2D" parent="PhaseOne"]
|
||||
|
|
|
@ -17,6 +17,10 @@ func _ready():
|
|||
|
||||
func _on_fire_intensity_changed(value):
|
||||
$Choir.volume_db = (smoothstep(choir_min, choir_max, value) - 1) * 60
|
||||
$Choir.bus = "Master" if $Choir.volume_db > -60 else "Mute"
|
||||
|
||||
$Bell.volume_db = (smoothstep(bell_min, bell_max, value) - 1) * 60
|
||||
$Bell.bus = "Master" if $Choir.volume_db > -60 else "Mute"
|
||||
|
||||
$Drum.volume_db = (smoothstep(drum_min, drum_max, value) - 1) * 60
|
||||
pass
|
||||
$Drum.bus = "Master" if $Choir.volume_db > -60 else "Mute"
|
||||
|
|
Loading…
Reference in a new issue