From d42d36817ff6a8e2ccfa55b4906c9506fc67ef93 Mon Sep 17 00:00:00 2001 From: MtH Date: Thu, 8 Apr 2021 03:29:32 +0200 Subject: [PATCH] NEEDS TESTING: delay note miss by one frame to fix lag causing misses --- source/Note.hx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/source/Note.hx b/source/Note.hx index d0b582e50..9f7719c78 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -25,6 +25,7 @@ class Note extends FlxSprite public var tooLate:Bool = false; public var wasGoodHit:Bool = false; public var prevNote:Note; + private var willMiss:Bool = false; public var sustainLength:Float = 0; public var isSustainNote:Bool = false; @@ -126,7 +127,6 @@ class Note extends FlxSprite case 0: x += swagWidth * 0; animation.play('purpleScroll'); - case 1: x += swagWidth * 1; animation.play('blueScroll'); @@ -201,15 +201,25 @@ class Note extends FlxSprite if (mustPress) { - // The * 0.5 is so that it's easier to hit them too late, instead of too early - if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset - && strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) - canBeHit = true; - else - canBeHit = false; - - if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit) + // miss on the NEXT frame so lag doesnt make u miss notes + if (willMiss) + { tooLate = true; + canBeHit = false; + } + else + { + if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset) + { // The * 0.5 is so that it's easier to hit them too late, instead of too early + if (strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) + canBeHit = true; + } + else + { + canBeHit = true; + willMiss = true; + } + } } else {