From 298e31c5d5854ab24bc2ce2d0721117694f79768 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Sun, 8 Oct 2023 13:29:35 -0400 Subject: [PATCH] musical menu sounds :) --- objects/hud/menu_sounds.gd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/objects/hud/menu_sounds.gd b/objects/hud/menu_sounds.gd index 8b3ab81..ce3a479 100644 --- a/objects/hud/menu_sounds.gd +++ b/objects/hud/menu_sounds.gd @@ -1,10 +1,18 @@ 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 current_note: int = 0 + +onready var select_sound: AudioStreamPlayer = $"%SelectSound" func play_select_sound(): 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: can_play = true