musical menu sounds :)

This commit is contained in:
Haze Weathers 2023-10-08 13:29:35 -04:00
parent b4952da4d8
commit 298e31c5d5

View file

@ -1,10 +1,18 @@
extends Node extends Node
const SEMITONE := 1.05946
const RUMBLE := [0.0, 0.0, 5.0, 7.0, 10.0, 0.0, 5.0, 7.0, 10.0, 7.0]
var can_play: bool = false var can_play: bool = false
var current_note: int = 0
onready var select_sound: AudioStreamPlayer = $"%SelectSound"
func play_select_sound(): func play_select_sound():
if can_play: if can_play:
$"%SelectSound".play() select_sound.pitch_scale = pow(SEMITONE, RUMBLE[current_note])
current_note = posmod(current_note + 1, RUMBLE.size())
select_sound.play()
else: else:
can_play = true can_play = true