NEEDS TESTING: delay note miss by one frame to fix lag causing misses

This commit is contained in:
MtH 2021-04-08 03:29:32 +02:00
parent a2ae9bbcd1
commit d42d36817f
1 changed files with 19 additions and 9 deletions

View File

@ -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
{