diff --git a/src/Sounds/arrow.mp3 b/src/Sounds/arrow.mp3 index ccfe4d6..52a79cc 100644 Binary files a/src/Sounds/arrow.mp3 and b/src/Sounds/arrow.mp3 differ diff --git a/src/Sounds/branch.mp3 b/src/Sounds/branch.mp3 index 9615dc4..d0906b3 100644 Binary files a/src/Sounds/branch.mp3 and b/src/Sounds/branch.mp3 differ diff --git a/src/Sounds/death.mp3 b/src/Sounds/death.mp3 index ca881d8..a909879 100644 Binary files a/src/Sounds/death.mp3 and b/src/Sounds/death.mp3 differ diff --git a/src/entities/Bullet.tscn b/src/entities/Bullet.tscn index 9de1d33..f98366b 100644 --- a/src/entities/Bullet.tscn +++ b/src/entities/Bullet.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://src/mechanics/Arrow.png" type="Texture" id=1] [ext_resource path="res://src/entities/behaviours/BulletMovement.gd" type="Script" id=2] [ext_resource path="res://src/entities/behaviours/Ownership.tscn" type="PackedScene" id=3] [ext_resource path="res://src/entities/Bullet.gd" type="Script" id=4] +[ext_resource path="res://src/entities/behaviours/ArrowSound.gd" type="Script" id=5] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 16, 8 ) @@ -24,4 +25,7 @@ texture = ExtResource( 1 ) script = ExtResource( 2 ) [node name="Ownership" parent="." instance=ExtResource( 3 )] + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +script = ExtResource( 5 ) [connection signal="hit" from="BulletMovement" to="." method="_on_BulletMovement_hit"] diff --git a/src/entities/behaviours/ArrowSound.gd b/src/entities/behaviours/ArrowSound.gd new file mode 100644 index 0000000..d04cabe --- /dev/null +++ b/src/entities/behaviours/ArrowSound.gd @@ -0,0 +1,10 @@ +extends AudioStreamPlayer + +func _ready(): + set_stream(load("res://src/Sounds/arrow.mp3")) + play() + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass