Complete note spawner implementation.
This commit is contained in:
@@ -60,6 +60,8 @@ func _set_visual_for_tap_at(note_id: int) -> void:
|
||||
var lane_id: int = notes.lane_at(note_id)
|
||||
var lane: Lane = lanes[lane_id]
|
||||
var note: TapNote = pool.get_tap()
|
||||
note.id = note_id
|
||||
note.hit_beat = notes.beat_at(note_id)
|
||||
lane.add_child(note)
|
||||
_note_visuals[note_id] = note
|
||||
|
||||
@@ -67,6 +69,8 @@ func _set_visual_for_hold_start_at(note_id: int) -> void:
|
||||
var lane_id: int = notes.lane_at(note_id)
|
||||
var lane: Lane = lanes[lane_id]
|
||||
var note: HoldNote = pool.get_hold()
|
||||
note.start_id = note_id
|
||||
note.hit_beat = notes.beat_at(note_id)
|
||||
lane.add_child(note)
|
||||
_note_visuals[note_id] = note
|
||||
_last_lane_holds[lane_id] = note
|
||||
@@ -82,10 +86,23 @@ func _set_visual_for_hold_end_at(note_id: int) -> void:
|
||||
_last_lane_holds[lane_id] = null
|
||||
|
||||
func _remove_visual_for_tap_at(note_id: int) -> void:
|
||||
pass
|
||||
var note: TapNote = _note_visuals.get(note_id) as TapNote
|
||||
if note == null:
|
||||
return
|
||||
pool.return_tap(note)
|
||||
|
||||
func _remove_visual_for_hold_start_at(note_id: int) -> void:
|
||||
pass
|
||||
var note: HoldNote = _note_visuals.get(note_id) as HoldNote
|
||||
if note == null:
|
||||
return
|
||||
note.start_id = -1
|
||||
if note.end_id < 0:
|
||||
pool.return_hold(note)
|
||||
|
||||
func _remove_visual_for_hold_end_at(note_id: int) -> void:
|
||||
pass
|
||||
var note: HoldNote = _note_visuals.get(note_id) as HoldNote
|
||||
if note == null:
|
||||
return
|
||||
note.end_id = -1
|
||||
if note.start_id < 0:
|
||||
pool.return_hold(note)
|
||||
|
||||
Reference in New Issue
Block a user