Fix bugs in note controller being removed

This commit is contained in:
2024-06-27 17:00:32 -03:00
parent 9475b5d12c
commit 4ebc18d56a
4 changed files with 13 additions and 18 deletions

View File

@ -13,7 +13,8 @@ func _ready():
func button_pressed():
NotePlayer.stream = NoteAudio
NotePlayer.play()
if !NotePlayer.playing:
NotePlayer.play()
func chord_changed(chord):
var resource_string = "res://audio/%s/%s%s.ogg" % [chord, chord, self.name]

View File

@ -7,10 +7,10 @@ var NotePlayer: AudioStreamPlayer
func _ready():
RhythmPlayer = get_node("/root/Control/RhythmPlayer")
ChordPlayer = get_node("/root/Control/ChordPlayer")
NotePlayer = get_node("/root/Control/NotePlayer")
self.pressed.connect(button_pressed)
func button_pressed():
RhythmPlayer.stop()
ChordPlayer.stop()
NotePlayer.stop()
if RhythmPlayer.playing:
RhythmPlayer.stop()
if ChordPlayer.playing:
ChordPlayer.stop()