20 lines
489 B
GDScript
20 lines
489 B
GDScript
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:
|
|
select_sound.pitch_scale = pow(SEMITONE, RUMBLE[current_note])
|
|
current_note = posmod(current_note + 1, RUMBLE.size())
|
|
select_sound.play()
|
|
else:
|
|
can_play = true
|
|
|
|
func play_confirm_sound():
|
|
$"%ConfirmSound".play()
|