diff options
Diffstat (limited to 'Scenes/Utilities.gd')
-rw-r--r-- | Scenes/Utilities.gd | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd index f9485ff..f7a5d5d 100644 --- a/Scenes/Utilities.gd +++ b/Scenes/Utilities.gd @@ -69,6 +69,18 @@ func fade_screen(from: Color, to: Color, duration: float = SCREEN_FADE_DURATION) return tween +func fade_bg_music(duration: float = SCREEN_FADE_DURATION): + if get_tree().current_scene.has_node("MusicBackground"): + var music = get_tree().current_scene.get_node("MusicBackground") + var tween = get_tree().create_tween() + tween.tween_property( + music, + "volume_db", + ProjectSettings.get_setting("audio/buses/channel_disable_threshold_db"), + duration + ) + + func get_collision_shape_bounds(collision_shape: CollisionShape2D): var shape: Shape2D = collision_shape.shape var bounds @@ -97,7 +109,7 @@ class Collision: func _init(node: Node2D, original_collision_shape: Node2D, expand: bool = true): self.name = "CollisionArea" - super() + #super() # setup area self.collision_layer = node.collision_layer |