浏览代码

:music: Add laser sound to javelot

DricomDragon 8 月之前
父节点
当前提交
5070b005bc

+ 8 - 1
godot/composants/objets/javelot/javelot.tscn

@@ -1,12 +1,14 @@
-[gd_scene load_steps=4 format=3 uid="uid://cotwb2mk31lpx"]
+[gd_scene load_steps=5 format=3 uid="uid://cotwb2mk31lpx"]
 
 [ext_resource type="Texture2D" uid="uid://iahia86rgssf" path="res://composants/objets/javelot/mcJavelot.png" id="1_00b17"]
 [ext_resource type="Script" path="res://composants/objets/javelot/javelot.gd" id="1_cih4f"]
+[ext_resource type="AudioStream" uid="uid://dhkoh1k0p01pq" path="res://composants/objets/javelot/laser_sound.wav" id="3_b2ei5"]
 
 [sub_resource type="RectangleShape2D" id="RectangleShape2D_0j83v"]
 size = Vector2(14, 14)
 
 [node name="Javelot" type="Node2D"]
+position = Vector2(210, 400)
 script = ExtResource("1_cih4f")
 
 [node name="Image" type="Sprite2D" parent="."]
@@ -26,5 +28,10 @@ shape = SubResource("RectangleShape2D_0j83v")
 [node name="VerificateurVisibilite" type="VisibleOnScreenNotifier2D" parent="."]
 rect = Rect2(-16, -16, 32, 300)
 
+[node name="BruitLaser" type="AudioStreamPlayer2D" parent="."]
+stream = ExtResource("3_b2ei5")
+autoplay = true
+bus = &"Bruits"
+
 [connection signal="body_entered" from="ZoneDestructive" to="." method="_quand_corps_entre_dans_zone_destructive"]
 [connection signal="screen_exited" from="VerificateurVisibilite" to="." method="_quand_verificateur_visibilite_detecte_sortie_ecran"]

二进制
godot/composants/objets/javelot/laser_sound.wav


+ 24 - 0
godot/composants/objets/javelot/laser_sound.wav.import

@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://dhkoh1k0p01pq"
+path="res://.godot/imported/laser_sound.wav-4c4a89072355424b53acdae71a8cd117.sample"
+
+[deps]
+
+source_file="res://composants/objets/javelot/laser_sound.wav"
+dest_files=["res://.godot/imported/laser_sound.wav-4c4a89072355424b53acdae71a8cd117.sample"]
+
+[params]
+
+force/8_bit=false
+force/mono=false
+force/max_rate=false
+force/max_rate_hz=44100
+edit/trim=false
+edit/normalize=false
+edit/loop_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=0