Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
fix sustain notes display bug thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Dec 5, 2023
1 parent a484fe7 commit a410481
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions source/funkin/objects/note/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ class Note extends FlxSpriteExt implements INoteData {

override function update(elapsed:Float) {
super.update(elapsed);
if (targetStrum == null) return; // Move to strum
if (targetStrum == null) { // No strum to move towards
__doDraw();
return;
}

noteMove = getMillPos(Conductor.songPosition - strumTime); // Position with strumtime
strumCenter = isSustainNote ? targetStrum.y + targetStrum.swagHeight * 0.5 : targetStrum.y; // Center of the target strum
y = strumCenter - (noteMove * getCos(approachAngle)); // Set Position
Expand All @@ -117,6 +121,7 @@ class Note extends FlxSpriteExt implements INoteData {
calcHit();
}

__doDraw();
active = Conductor.songPosition < (strumTime + initSusLength + getPosMill(NoteUtil.swagHeight * 2));
}

Expand All @@ -132,10 +137,7 @@ class Note extends FlxSpriteExt implements INoteData {
}

override function draw() { // This should help a bit on performance
if (drawNote) {
__doDraw();
super.draw();
}
if (drawNote) super.draw();
}

inline public function hideNote() {
Expand Down

0 comments on commit a410481

Please sign in to comment.