diff --git a/rhythm_game/note/score/score_array.gd b/rhythm_game/note/score/score_array.gd index aac2a48..c26a8d5 100644 --- a/rhythm_game/note/score/score_array.gd +++ b/rhythm_game/note/score/score_array.gd @@ -1,10 +1,21 @@ class_name ScoreArray extends Node +## The note array this score refers to. +## WARNING: Changing the note data clears all scores. var notes: NoteArray: set = _set_notes +## Set a score for the note at [param index] in [member notes]. +## [param offset] is how off the note hit was in seconds. +func set_score(index: int, offset: float) -> void: + _scores.set(index, offset) + # ======== IMPLEMENTATION ======== # -var scores: Array[Note.SCORE] +var _scores: Array[float] func _set_notes(p_notes: NoteArray) -> void: + if notes == p_notes: + return notes = p_notes + _scores.clear() + _scores.resize(notes.size())