Small optimizations + Automatic Note Limit

This commit is contained in:
Ne_Eo
2024-08-20 02:35:51 +02:00
parent 49a8861420
commit e51439b53e
3 changed files with 643 additions and 4 deletions
+9 -3
View File
@@ -148,6 +148,11 @@ class StrumLine extends FlxTypedGroup<Strum> {
}
}
notes.sortNotes();
var scrollSpeed = strumLine.scrollSpeed;
if(scrollSpeed == null) if (PlayState.instance != null) scrollSpeed = PlayState.instance.scrollSpeed;
if(scrollSpeed == null) scrollSpeed = 1;
notes.limit = 1500 / scrollSpeed;
}
public override function update(elapsed:Float) {
@@ -179,10 +184,11 @@ class StrumLine extends FlxTypedGroup<Strum> {
if (__updateNote_event.cancelled) return;
if (__updateNote_event.__updateHitWindow) {
daNote.canBeHit = (daNote.strumTime > __updateNote_songPos - (PlayState.instance.hitWindow * daNote.latePressWindow)
&& daNote.strumTime < __updateNote_songPos + (PlayState.instance.hitWindow * daNote.earlyPressWindow));
var hitWindow = PlayState.instance.hitWindow;
daNote.canBeHit = (daNote.strumTime > __updateNote_songPos - (hitWindow * daNote.latePressWindow)
&& daNote.strumTime < __updateNote_songPos + (hitWindow * daNote.earlyPressWindow));
if (daNote.strumTime < __updateNote_songPos - PlayState.instance.hitWindow && !daNote.wasGoodHit)
if (daNote.strumTime < __updateNote_songPos - hitWindow && !daNote.wasGoodHit)
daNote.tooLate = true;
}