Skip to content

Commit 2bc6386

Browse files
authored
fix down/negative scroll again Hopefully (#1043)
few things were missing that bugged stuff out: - downscroll would cause (manually x-moved) notes to spaz out each frame (pausing included) if their updateNotesPosX was false - negative scroll speed now updates correctly , previous version would kinda either delay the sustain flip or not function at all due to being blocked by a return early
1 parent f7d1ab1 commit 2bc6386

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

source/funkin/game/Note.hx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class Note extends FlxSprite
229229
return v;
230230
}
231231
inline function get_useAntialiasingFix() {
232-
return gapFix>0;
232+
return gapFix > 0;
233233
}
234234

235235
/**
@@ -288,14 +288,15 @@ class Note extends FlxSprite
288288

289289
@:noCompletion @:dox(hide) override function isOnScreen(?camera:FlxCamera):Bool {
290290
var downscrollCam = (Std.isOfType(camera, HudCamera) ? cast(camera, HudCamera).downscroll : false);
291-
291+
if (updateFlipY) {
292+
flipY = (isSustainNote && flipSustain) && (downscrollCam != (lastScrollSpeed < 0));
293+
}
292294
if (downscrollCam == __lastDownscrollCam)
293295
return super.isOnScreen(camera);
294296
else
295297
__lastX = x;
296298

297-
if (updateFlipY) flipY = (isSustainNote && flipSustain) && (downscrollCam != (__strum != null && __strum.getScrollSpeed(this) < 0));
298-
if (downscrollCam && __strum != null) {
299+
if (downscrollCam && __strum != null && __strum.updateNotesPosX && updateNotesPosX) {
299300
x = -x + 2 * (__strum.x - origin.x + offset.x) + __strum.width;
300301
}
301302
final isOnScreen = super.isOnScreen(camera);
@@ -312,7 +313,7 @@ class Note extends FlxSprite
312313
}
313314

314315
public function isOnScreenOriginal(?camera:FlxCamera):Bool {
315-
return super.isOnScreen(camera);
316+
return super.isOnScreen(camera);
316317
}
317318

318319
public var earlyPressWindow:Float = Flags.EARLY_HIT_WINDOW_RANGE;
@@ -324,7 +325,7 @@ class Note extends FlxSprite
324325
if (lastScrollSpeed != scrollSpeed) {
325326
lastScrollSpeed = scrollSpeed;
326327
if (nextSustain != null) {
327-
scale.y = (sustainLength * 0.45 * scrollSpeed) / frameHeight;
328+
scale.y = (sustainLength * 0.45 * Math.abs(scrollSpeed)) / frameHeight;
328329
updateHitbox();
329330
scale.y += gapFix / frameHeight;
330331
}
@@ -334,7 +335,7 @@ class Note extends FlxSprite
334335
}
335336

336337
public function updateSustainClip() if (wasGoodHit && !noSustainClip) {
337-
var t = CoolUtil.bound((Conductor.songPosition - strumTime) / height * 0.45 * lastScrollSpeed, 0, 1);
338+
var t = CoolUtil.bound((Conductor.songPosition - strumTime) / height * 0.45 * Math.abs(lastScrollSpeed), 0, 1);
338339
@:bypassAccessor {
339340
if (clipRect == null) clipRect = FlxRect.get();
340341
clipRect.set(0, frameHeight * t, frameWidth, frameHeight * (1 - t));

0 commit comments

Comments
 (0)