Added a dampening (lowpass) spatial audio effect for obstacles between the player and the audio source

This commit is contained in:
ChaoticByte 2024-10-06 00:43:05 +02:00
parent e147517ad2
commit 47c8576f66
No known key found for this signature in database
3 changed files with 58 additions and 12 deletions

View file

@ -1,7 +1,9 @@
[gd_scene load_steps=3 format=3 uid="uid://c6w7lrydi43ts"]
[gd_scene load_steps=5 format=3 uid="uid://c6w7lrydi43ts"]
[ext_resource type="PackedScene" uid="uid://cbynoofsjcl45" path="res://core/polygon/polygon.tscn" id="1_cup10"]
[ext_resource type="Script" path="res://levels/intro.gd" id="1_pgj82"]
[ext_resource type="Script" path="res://core/audio/spatial_audio_player.gd" id="3_3eqhh"]
[ext_resource type="AudioStream" uid="uid://cs6l2t3jtags8" path="res://assets/sounds/clock-tick-76039.mp3" id="3_6yss2"]
[node name="Intro" type="Node2D"]
script = ExtResource("1_pgj82")
@ -30,5 +32,12 @@ color = Color(1, 0.1, 0, 1)
polygon = PackedVector2Array(416, 400, 416, 424, 440, 424, 440, 400)
color = Color(0.484431, 0.687354, 1, 1)
[node name="SpatialAudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
position = Vector2(768, 328)
stream = ExtResource("3_6yss2")
volume_db = 15.0
autoplay = true
script = ExtResource("3_3eqhh")
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
[connection signal="body_entered" from="next_level" to="." method="_on_next_level_body_entered"]