diff --git a/assets/audio/defeat.mp3 b/assets/audio/defeat.mp3 new file mode 100644 index 0000000..2ee8beb Binary files /dev/null and b/assets/audio/defeat.mp3 differ diff --git a/assets/audio/defeat.mp3.import b/assets/audio/defeat.mp3.import new file mode 100644 index 0000000..d0092f7 --- /dev/null +++ b/assets/audio/defeat.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cqbl8resqabdd" +path="res://.godot/imported/defeat.mp3-f01dad10637c8b3d020ef767028b9b11.mp3str" + +[deps] + +source_file="res://assets/audio/defeat.mp3" +dest_files=["res://.godot/imported/defeat.mp3-f01dad10637c8b3d020ef767028b9b11.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/scenes/ui/defeat.tscn b/scenes/ui/defeat.tscn index fc98f38..3ae2a56 100644 --- a/scenes/ui/defeat.tscn +++ b/scenes/ui/defeat.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=3 uid="uid://wywjvwp7ausj"] +[gd_scene load_steps=4 format=3 uid="uid://wywjvwp7ausj"] [ext_resource type="Texture2D" uid="uid://b3sb2q80p1fbd" path="res://assets/icons/defeat.png" id="1_bioyr"] [ext_resource type="Script" path="res://scripts/ui/defeat.gd" id="1_sbbw3"] +[ext_resource type="AudioStream" uid="uid://cqbl8resqabdd" path="res://assets/audio/defeat.mp3" id="3_xsj1k"] [node name="Defeat" type="Control"] process_mode = 2 @@ -49,4 +50,8 @@ size_flags_horizontal = 4 size_flags_vertical = 6 text = "Main Menu" +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_xsj1k") +volume_db = -30.0 + [connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/MainMenu" to="." method="_on_main_menu_pressed"] diff --git a/scripts/stages/1/game_manager.gd b/scripts/stages/1/game_manager.gd index 039e65f..b7201ae 100644 --- a/scripts/stages/1/game_manager.gd +++ b/scripts/stages/1/game_manager.gd @@ -106,6 +106,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/2/game_manager.gd b/scripts/stages/2/game_manager.gd index d73a3ef..7e01e85 100644 --- a/scripts/stages/2/game_manager.gd +++ b/scripts/stages/2/game_manager.gd @@ -105,6 +105,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/3/game_manager.gd b/scripts/stages/3/game_manager.gd index 4099672..c310298 100644 --- a/scripts/stages/3/game_manager.gd +++ b/scripts/stages/3/game_manager.gd @@ -105,6 +105,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/4/game_manager.gd b/scripts/stages/4/game_manager.gd index bfbdc13..1fbc652 100644 --- a/scripts/stages/4/game_manager.gd +++ b/scripts/stages/4/game_manager.gd @@ -105,6 +105,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/5/game_manager.gd b/scripts/stages/5/game_manager.gd index e73d89b..498be95 100644 --- a/scripts/stages/5/game_manager.gd +++ b/scripts/stages/5/game_manager.gd @@ -105,6 +105,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/6/game_manager.gd b/scripts/stages/6/game_manager.gd index 1826be2..29bd87c 100644 --- a/scripts/stages/6/game_manager.gd +++ b/scripts/stages/6/game_manager.gd @@ -105,6 +105,7 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true $CanvasLayer/Defeat.show() + $CanvasLayer/Defeat/AudioStreamPlayer.play() func on_enemy_reward(value: int): data['resource'] += value