Add sound effect to Victory UI

This commit is contained in:
Moe Poi ~ 2023-10-21 23:29:42 +07:00
parent f9bdd46250
commit 75a899d41c
9 changed files with 35 additions and 5 deletions

BIN
assets/audio/victory.mp3 Normal file

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://b6sp0yj21vn17"
path="res://.godot/imported/victory.mp3-2c0e4c1c0aa8ee4be09ba0e64d5076dc.mp3str"
[deps]
source_file="res://assets/audio/victory.mp3"
dest_files=["res://.godot/imported/victory.mp3-2c0e4c1c0aa8ee4be09ba0e64d5076dc.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://r8kq68v8iflb"] [gd_scene load_steps=4 format=3 uid="uid://r8kq68v8iflb"]
[ext_resource type="Texture2D" uid="uid://bbll7rkbty50k" path="res://assets/icons/victory.png" id="1_3fse5"] [ext_resource type="Texture2D" uid="uid://bbll7rkbty50k" path="res://assets/icons/victory.png" id="1_3fse5"]
[ext_resource type="Script" path="res://scripts/ui/victory.gd" id="1_qdex0"] [ext_resource type="Script" path="res://scripts/ui/victory.gd" id="1_qdex0"]
[ext_resource type="AudioStream" uid="uid://b6sp0yj21vn17" path="res://assets/audio/victory.mp3" id="3_ya7rd"]
[node name="Victory" type="Control"] [node name="Victory" type="Control"]
process_mode = 2 process_mode = 2
@ -49,4 +50,8 @@ size_flags_horizontal = 4
size_flags_vertical = 6 size_flags_vertical = 6
text = "Next Stage" text = "Next Stage"
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_ya7rd")
volume_db = -30.0
[connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/NextStage" to="." method="_on_next_stage_pressed"] [connection signal="pressed" from="Panel/MarginContainer/VBoxContainer/NextStage" to="." method="_on_next_stage_pressed"]

View file

@ -115,3 +115,4 @@ func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()

View file

@ -113,4 +113,5 @@ func on_enemy_reward(value: int):
func _on_duration_timeout(): func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()

View file

@ -114,3 +114,4 @@ func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()

View file

@ -113,4 +113,5 @@ func on_enemy_reward(value: int):
func _on_duration_timeout(): func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()

View file

@ -113,4 +113,5 @@ func on_enemy_reward(value: int):
func _on_duration_timeout(): func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()

View file

@ -113,4 +113,5 @@ func on_enemy_reward(value: int):
func _on_duration_timeout(): func _on_duration_timeout():
get_tree().paused = true get_tree().paused = true
$CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.unlock_next_stage()
$CanvasLayer/Victory.show() $CanvasLayer/Victory.show()
$CanvasLayer/Victory/AudioStreamPlayer.play()