adding sound to menu
This commit is contained in:
parent
5a278ca062
commit
d255435c93
8 changed files with 190 additions and 7 deletions
|
@ -25,6 +25,8 @@ var is_typing = true
|
|||
var current_button_index = 0
|
||||
var buttons = []
|
||||
|
||||
@onready var typing_sound_player = $TypingSoundPlayer
|
||||
|
||||
func _ready():
|
||||
for hbox in $VBoxContainer/Buttons.get_children():
|
||||
hbox.visible = false
|
||||
|
@ -92,6 +94,10 @@ func _update_text() -> void:
|
|||
if char_index < display_text.length():
|
||||
current_text += display_text[char_index]
|
||||
$VBoxContainer/VBoxContainer2/Label.text = current_text
|
||||
|
||||
if typing_sound_player and not typing_sound_player.is_playing():
|
||||
typing_sound_player.play()
|
||||
|
||||
char_index += 1
|
||||
await get_tree().create_timer(typing_speed).timeout
|
||||
_update_text()
|
||||
|
@ -99,6 +105,7 @@ func _update_text() -> void:
|
|||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
|
||||
func _show_menu_options() -> void:
|
||||
for hbox in $VBoxContainer/Buttons.get_children():
|
||||
hbox.visible = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue