From a528943b91a1716a4f4aeaecefdef5713cafa416 Mon Sep 17 00:00:00 2001 From: godzilla5hrimp Date: Sun, 20 Sep 2026 17:04:57 +0200 Subject: [PATCH] feat: add music to the main scene and sfx for the npcs; --- Scenes/GameScene/game_scene.tscn | 8 ++++++++ Scenes/NPC/npc.gd | 2 ++ Scenes/NPC/npc.tscn | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/Scenes/GameScene/game_scene.tscn b/Scenes/GameScene/game_scene.tscn index 4650855..bcd8706 100644 --- a/Scenes/GameScene/game_scene.tscn +++ b/Scenes/GameScene/game_scene.tscn @@ -14,6 +14,7 @@ [ext_resource type="PackedScene" uid="uid://bdu180bpjrn5h" path="res://Scenes/Switch/switch.tscn" id="8_njm7v"] [ext_resource type="PackedScene" uid="uid://bqcsg2t581j7b" path="res://Scenes/TreasureChest/treasure_chest.tscn" id="9_bkvnf"] [ext_resource type="PackedScene" uid="uid://dsb83tlcapw8l" path="res://Scenes/NPC/npc.tscn" id="10_g3lhp"] +[ext_resource type="AudioStream" uid="uid://bhl6upyji6aap" path="res://Ninja Adventure - Asset Pack/Musics/5 - Peaceful.ogg" id="15_rpdpv"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_04h35"] texture = ExtResource("1_l6yvh") @@ -863,6 +864,13 @@ limit_top = -144 limit_right = 192 limit_bottom = 160 +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="." unique_id=1027726927] +process_mode = 3 +stream = ExtResource("15_rpdpv") +volume_db = -5.0 +autoplay = true +parameters/looping = true + [connection signal="pressed" from="PuzzleButton" to="LockedDoor" method="_on_puzzle_button_pressed"] [connection signal="unpressed" from="PuzzleButton" to="LockedDoor" method="_on_puzzle_button_unpressed"] diff --git a/Scenes/NPC/npc.gd b/Scenes/NPC/npc.gd index 254cb55..fcea4dc 100644 --- a/Scenes/NPC/npc.gd +++ b/Scenes/NPC/npc.gd @@ -9,6 +9,8 @@ func _process(delta: float) -> void: if $CanvasLayer.visible == false: $CanvasLayer.visible = true get_tree().paused = true + $Greeting.play() else: $CanvasLayer.visible = false get_tree().paused = false + $Goodbye.play() diff --git a/Scenes/NPC/npc.tscn b/Scenes/NPC/npc.tscn index 012b174..815dd02 100644 --- a/Scenes/NPC/npc.tscn +++ b/Scenes/NPC/npc.tscn @@ -4,6 +4,8 @@ [ext_resource type="Script" uid="uid://b54jmbhu1hrbt" path="res://Scenes/NPC/npc.gd" id="1_bjna2"] [ext_resource type="Texture2D" uid="uid://ctpnixa3dpms5" path="res://Ninja Adventure - Asset Pack/Ui/Dialog/DialogBoxFaceset.png" id="3_0s07e"] [ext_resource type="Texture2D" uid="uid://cn881vxquv6ub" path="res://Ninja Adventure - Asset Pack/Actor/Characters/NinjaBlue/Faceset.png" id="4_aqj1y"] +[ext_resource type="AudioStream" uid="uid://q2f6qp5cd467" path="res://Ninja Adventure - Asset Pack/Sounds/Game/Voice1.wav" id="5_n8r46"] +[ext_resource type="AudioStream" uid="uid://kxkws5kmf3ru" path="res://Ninja Adventure - Asset Pack/Sounds/Game/Voice4.wav" id="6_fqw72"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_chgu2"] size = Vector2(14, 13) @@ -66,3 +68,9 @@ offset_right = 270.0 offset_bottom = 458.0 text = "Blue Ninja" label_settings = SubResource("LabelSettings_chgu2") + +[node name="Greeting" type="AudioStreamPlayer2D" parent="." unique_id=599558903] +stream = ExtResource("5_n8r46") + +[node name="Goodbye" type="AudioStreamPlayer2D" parent="." unique_id=712774027] +stream = ExtResource("6_fqw72")