diff --git a/levels/base_level/base_level.tscn b/levels/base_level/base_level.tscn index a07071d..36848e6 100644 --- a/levels/base_level/base_level.tscn +++ b/levels/base_level/base_level.tscn @@ -92,13 +92,13 @@ centered = false [node name="SFXs" type="Node" parent="."] -[node name="LevelClear" type="AudioStreamPlayer2D" parent="SFXs"] +[node name="LevelClear" type="AudioStreamPlayer" parent="SFXs"] stream = ExtResource("3_ou3kh") -volume_db = -5.0 +volume_db = -5.622 -[node name="WrongAnswer" type="AudioStreamPlayer2D" parent="SFXs"] +[node name="WrongAnswer" type="AudioStreamPlayer" parent="SFXs"] stream = ExtResource("4_yxsxp") -volume_db = 1.0 +volume_db = 4.685 [connection signal="pressed" from="HUDs/NextLevelButton" to="." method="_on_next_level_button_pressed"] [connection signal="pressed" from="HUDs/BackButton" to="." method="_on_back_button_pressed"] diff --git a/levels/base_level/bgm.wav b/levels/base_level/bgm.wav new file mode 100644 index 0000000..b8854dd Binary files /dev/null and b/levels/base_level/bgm.wav differ diff --git a/levels/base_level/bgm.wav.import b/levels/base_level/bgm.wav.import new file mode 100644 index 0000000..ca4edb5 --- /dev/null +++ b/levels/base_level/bgm.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cr3nkhf0fejm5" +path="res://.godot/imported/bgm.wav-5645fcab8b652fa4aadb063a7a671992.sample" + +[deps] + +source_file="res://levels/base_level/bgm.wav" +dest_files=["res://.godot/imported/bgm.wav-5645fcab8b652fa4aadb063a7a671992.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 diff --git a/main.gd b/main.gd index bfb6b2b..02e8f50 100644 --- a/main.gd +++ b/main.gd @@ -10,5 +10,11 @@ func _ready(): func _process(delta): pass +func _on_main_menu_enter_level(): + $BGMPlayer.play() + + +func _on_bgm_player_finished(): + $BGMPlayer.play() func set_victory(v: bool): $Bg/DynamicBg.set_victory(v) diff --git a/main.tscn b/main.tscn index d8634ad..daebbfc 100644 --- a/main.tscn +++ b/main.tscn @@ -1,14 +1,25 @@ -[gd_scene load_steps=4 format=3 uid="uid://c17fbsiogbgo1"] +[gd_scene load_steps=5 format=3 uid="uid://c17fbsiogbgo1"] [ext_resource type="Script" path="res://main.gd" id="1_d0et0"] [ext_resource type="PackedScene" uid="uid://c07co5p46apu7" path="res://objects/main_menu/main_menu.tscn" id="1_fk6j6"] +[ext_resource type="Script" path="res://main.gd" id="1_nb6uf"] [ext_resource type="PackedScene" uid="uid://d3geq38s5fjc6" path="res://bg/dynamic_bg/dynamic_bg.tscn" id="2_8k4il"] +[ext_resource type="AudioStream" uid="uid://cr3nkhf0fejm5" path="res://levels/base_level/bgm.wav" id="3_n81it"] [node name="Main" type="Node"] -script = ExtResource("1_d0et0") +script = ExtResource("1_nb6uf") [node name="MainMenu" parent="." instance=ExtResource("1_fk6j6")] [node name="Bg" type="Node" parent="."] [node name="DynamicBg" parent="Bg" instance=ExtResource("2_8k4il")] + +[node name="BGMPlayer" type="AudioStreamPlayer2D" parent="."] +position = Vector2(234, 150) +stream = ExtResource("3_n81it") +volume_db = -4.685 +attenuation = 0.0001 + +[connection signal="enter_level" from="MainMenu" to="." method="_on_main_menu_enter_level"] +[connection signal="finished" from="BGMPlayer" to="." method="_on_bgm_player_finished"] diff --git a/objects/card/card.tscn b/objects/card/card.tscn index 6e08db5..0c0571d 100644 --- a/objects/card/card.tscn +++ b/objects/card/card.tscn @@ -51,9 +51,9 @@ shape = SubResource("RectangleShape2D_gu6l6") sprite_frames = SubResource("SpriteFrames_fo0r0") autoplay = "default" -[node name="SFXPutDown" type="AudioStreamPlayer2D" parent="."] +[node name="SFXPutDown" type="AudioStreamPlayer" parent="."] stream = ExtResource("7_u4ylf") -volume_db = 6.558 +volume_db = 13.117 [connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] [connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] diff --git a/objects/card_base/card_base.tscn b/objects/card_base/card_base.tscn index 3e0a797..1bdbd1b 100644 --- a/objects/card_base/card_base.tscn +++ b/objects/card_base/card_base.tscn @@ -64,14 +64,14 @@ sprite_frames = SubResource("SpriteFrames_bhb3x") [node name="Cards" type="Node" parent="."] -[node name="SFXPickUp" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource("7_0c7kt") -volume_db = 8.54 - [node name="FadeTimer" type="Timer" parent="."] wait_time = 0.2 one_shot = true +[node name="SFXPickUp" type="AudioStreamPlayer" parent="."] +stream = ExtResource("7_0c7kt") +volume_db = 9.58 + [connection signal="area_entered" from="." to="." method="_on_area_entered"] [connection signal="area_exited" from="." to="." method="_on_area_exited"] [connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] diff --git a/objects/main_menu/main_menu.gd b/objects/main_menu/main_menu.gd index e7207db..4f262ab 100644 --- a/objects/main_menu/main_menu.gd +++ b/objects/main_menu/main_menu.gd @@ -2,6 +2,9 @@ extends AnimatedSprite2D const ChapterMenu = preload("res://levels/chapter_menu/chapter_menu.tscn") const BaseLevel := preload("res://levels/base_level/base_level.tscn") + +signal enter_level() + # Called when the node enters the scene tree for the first time. func _ready(): $start_button/AnimatedSprite2D.play() @@ -24,6 +27,7 @@ func _on_start_button_pressed(): base_level.init(0, 0) get_tree().root.add_child(base_level) + enter_level.emit() queue_free() #get_tree().root.add_child(ChapterMenu.instantiate()) #queue_free()