TODO: Audio.tscn

This commit is contained in:
Harmony Honey 2023-12-28 13:44:18 -05:00
parent d5bc068952
commit 86aad52961
3 changed files with 9 additions and 2 deletions

View file

@ -103,6 +103,7 @@ Wipe="*res://src/autoload/Wipe.tscn"
UI="*res://src/autoload/UI.tscn"
SilentWolf="*res://addons/silent_wolf/SilentWolf.gd"
Leaderboard="*res://src/autoload/Leaderboard.gd"
Audio="*res://src/autoload/Audio.tscn"
[display]

View file

@ -51,8 +51,7 @@ func _input(event):
if up or down:
set_cursor(cursor + (-1 if up else 1))
write_menu()
node_audio_scroll.pitch_scale = 1 + rand_range(-0.2, 0.2)
node_audio_scroll.play()
Audio.play("pause_scroll", 0.8, 1.2)
func toggle_pause():
is_paused = !is_paused

View file

@ -377,3 +377,10 @@ func set_window_scale(arg := window_scale):
# center window
OS.set_window_position(OS.get_screen_size() * 0.5 - OS.get_window_size() * 0.5)
return "window_scale: " + str(window_scale) + " - resolution: " + str(OS.get_window_size())
func get_all_children(n, a := []):
if is_instance_valid(n):
a.append(n)
for i in n.get_children():
a = get_all_children(i, a)
return a