update sound for menus

This commit is contained in:
Fabio 2024-08-20 18:35:52 +02:00
parent d29a1ff019
commit 488ec31f8f
6 changed files with 33 additions and 3 deletions

View file

@ -17,6 +17,8 @@ var is_typing = true
var current_button_index = 0
var button
@onready var typing_sound_player = $TypingSoundPlayer
func _ready():
_initialize_menu()
_start_typing()
@ -71,6 +73,10 @@ func _update_text() -> void:
if char_index < credits_text.length():
current_text += credits_text[char_index]
$VBoxContainer/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()

View file

@ -19,6 +19,8 @@ var is_typing = true
var current_button_index = 0
var button
@onready var typing_sound_player = $TypingSoundPlayer
func _ready():
_initialize_menu()
_start_typing()
@ -73,6 +75,10 @@ func _update_text() -> void:
if char_index < credits_text.length():
current_text += credits_text[char_index]
$VBoxContainer/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()

View file

@ -21,6 +21,8 @@ var buttons = []
var current_scene = null
var pause_menu_node = null
@onready var typing_sound_player = $TypingSoundPlayer
func _ready():
current_scene = get_tree().current_scene
@ -79,6 +81,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()