diff --git a/scenes/campfire/CampfireBackground.tscn b/scenes/campfire/CampfireBackground.tscn index 203a545..0247208 100644 --- a/scenes/campfire/CampfireBackground.tscn +++ b/scenes/campfire/CampfireBackground.tscn @@ -12,6 +12,7 @@ centered = false [node name="FireCrackles" type="AudioStreamPlayer" parent="."] stream = ExtResource( 3 ) +volume_db = -6.0 autoplay = true [node name="Ely" type="AnimatedSprite" parent="."] diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn index 3f61d9d..eb27f4d 100644 --- a/scenes/main_menu.tscn +++ b/scenes/main_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://scripts/menu/title_background.gd" type="Script" id=1] [ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2] @@ -7,7 +7,6 @@ [ext_resource path="res://scripts/menu/MainMenu.gd" type="Script" id=5] [ext_resource path="res://images/main_menu/title_background_campfire.tres" type="SpriteFrames" id=6] [ext_resource path="res://images/main_menu/titleWithoutEly_loop.tres" type="SpriteFrames" id=7] -[ext_resource path="res://sounds/main_title.ogg" type="AudioStream" id=8] [ext_resource path="res://scripts/main_menu.gd" type="Script" id=9] [sub_resource type="StyleBoxEmpty" id=1] @@ -93,8 +92,5 @@ script = ExtResource( 3 ) __meta__ = { "_edit_use_anchors_": false } - -[node name="MainMusic" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 8 ) [connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"] [connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"] diff --git a/scripts/MusicPlayer.gd b/scripts/MusicPlayer.gd index ca60bf9..913b7b3 100644 --- a/scripts/MusicPlayer.gd +++ b/scripts/MusicPlayer.gd @@ -46,7 +46,7 @@ func get_free_track() -> AudioStreamPlayer: free_track = track if free_track == null: free_track = AudioStreamPlayer.new() - print('yo') + free_track.volume_db = -6 add_child(free_track) print(free_track) return free_track diff --git a/scripts/campfire2.gd b/scripts/campfire2.gd index 9692f72..276b133 100644 --- a/scripts/campfire2.gd +++ b/scripts/campfire2.gd @@ -9,6 +9,8 @@ export (String, FILE, '*.json') var end_1_dialogue export (String, FILE, '*.json') var end_truth_dialogue export (String, FILE, '*.json') var end_lie_dialogue +onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer + func _ready(): assert(end_1_dialogue != null) assert(end_truth_dialogue != null) @@ -24,6 +26,7 @@ var choice = -1 func make_choice(choice : int): the_choice.hide() + music_player.play("Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over") yield(dialogue_box.start_dialogue(end_truth_dialogue if choice == 0 else end_lie_dialogue), 'end') get_tree().change_scene("res://scenes/credits.tscn") diff --git a/scripts/game1/Game1Script.gd b/scripts/game1/Game1Script.gd index 240d546..b3b6415 100644 --- a/scripts/game1/Game1Script.gd +++ b/scripts/game1/Game1Script.gd @@ -11,6 +11,8 @@ var player_camera : Camera2D onready var dialogue_box = $UI/Dialog export (String, FILE, '*.json') var dialogue +onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer + onready var levels = [ #'TestLogEntity', 'Level1', @@ -38,6 +40,7 @@ func _ready(): return yield(get_tree().create_timer(6), "timeout") + music_player.play("Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves") $Opening1.play('default') $Opening1/Mask.play('default') $Opening1/OpeningOver.play('default') diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index ae5d0a7..8cbec23 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -1,5 +1,6 @@ extends Node2D +onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer func _ready(): - $MainMusic.play() + music_player.play('main_title') diff --git a/scripts/menu/MainMenu.gd b/scripts/menu/MainMenu.gd index 44decae..90bc5ea 100644 --- a/scripts/menu/MainMenu.gd +++ b/scripts/menu/MainMenu.gd @@ -1,5 +1,7 @@ extends Node +onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer + func _ready(): $Buttons/PlayButton.grab_focus() for button in $Buttons.get_children(): @@ -7,6 +9,8 @@ func _ready(): func _on_Button_pressed(scene_to_load : String): if scene_to_load != "": + music_player.fade_out() get_tree().change_scene(scene_to_load) else: + music_player.fade_out() get_tree().quit() diff --git a/scripts/oil_tanker.gd b/scripts/oil_tanker.gd index a85611c..122a055 100644 --- a/scripts/oil_tanker.gd +++ b/scripts/oil_tanker.gd @@ -4,6 +4,7 @@ signal can_leave var can_leave = false onready var dialogue_box = $UI/Dialog +onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer #0 onready var oil_tanker = $OilTanker @@ -105,6 +106,7 @@ func end_step_2(body : Node): yield(get_tree().create_timer(1), "timeout") yield(dialogue_box.start_dialogue(dialogue_5), 'end') yield(get_tree().create_timer(0.2), "timeout") + music_player.fade_out() get_tree().change_scene("res://scenes/campfire2.tscn") func _input(event): diff --git a/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg b/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg new file mode 100644 index 0000000..493d2f7 Binary files /dev/null and b/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg differ diff --git a/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg.import b/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg.import new file mode 100644 index 0000000..846bab1 --- /dev/null +++ b/sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg-7a0547bf1d516755a7b69367e9f6573a.oggstr" + +[deps] + +source_file="res://sounds/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg" +dest_files=[ "res://.import/Chris Zabriskie - Direct to Video - 03 I Don't See the Branches, I See the Leaves.ogg-7a0547bf1d516755a7b69367e9f6573a.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg b/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg new file mode 100644 index 0000000..792d534 Binary files /dev/null and b/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg differ diff --git a/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg.import b/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg.import new file mode 100644 index 0000000..46b2242 --- /dev/null +++ b/sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg-0c87f633d9f4f7ca0cb0ddc35e26b788.oggstr" + +[deps] + +source_file="res://sounds/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg" +dest_files=[ "res://.import/Chris Zabriskie - Direct to Video - 07 It's Always Too Late to Start Over.ogg-0c87f633d9f4f7ca0cb0ddc35e26b788.oggstr" ] + +[params] + +loop=true +loop_offset=0