From 96d36cee33d6321834565f0a5d412ef95c5ceffd Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 28 Dec 2023 09:07:41 +0100 Subject: next commit --- Scenes/Utilities.gd | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Scenes/Utilities.gd') 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 -- cgit v1.2.3