1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-29 08:16:58 +00:00

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 3db5184b71
commit ba62e4cb0e

View file

@ -25,6 +25,7 @@ class Note extends FlxSprite
public var tooLate:Bool = false; public var tooLate:Bool = false;
public var wasGoodHit:Bool = false; public var wasGoodHit:Bool = false;
public var prevNote:Note; public var prevNote:Note;
private var willMiss:Bool = false;
public var sustainLength:Float = 0; public var sustainLength:Float = 0;
public var isSustainNote:Bool = false; public var isSustainNote:Bool = false;
@ -126,7 +127,6 @@ class Note extends FlxSprite
case 0: case 0:
x += swagWidth * 0; x += swagWidth * 0;
animation.play('purpleScroll'); animation.play('purpleScroll');
case 1: case 1:
x += swagWidth * 1; x += swagWidth * 1;
animation.play('blueScroll'); animation.play('blueScroll');
@ -201,15 +201,25 @@ class Note extends FlxSprite
if (mustPress) if (mustPress)
{ {
// The * 0.5 is so that it's easier to hit them too late, instead of too early // miss on the NEXT frame so lag doesnt make u miss notes
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset if (willMiss)
&& strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) {
canBeHit = true;
else
canBeHit = false;
if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit)
tooLate = true; 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 else
{ {