1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-05 06:14:36 +00:00

boopin boppers.. head lerp

This commit is contained in:
MtH 2021-05-15 23:39:13 +02:00
parent d49858217e
commit 123a7ae59b
3 changed files with 9 additions and 7 deletions

View file

@ -57,10 +57,10 @@ class CoolUtil
} }
/* /*
* just lerp that does camLerpShit for u so u dont have to do it every time * frame dependant lerp kinda lol
*/ */
public static function coolLerp(a:Float, b:Float, ratio:Float):Float public static function coolLerp(base:Float, target:Float, ratio:Float):Float
{ {
return FlxMath.lerp(a, b, camLerpShit(ratio)); return base + camLerpShit(ratio) * (target - base);
} }
} }

View file

@ -1964,8 +1964,8 @@ class PlayState extends MusicBeatState
// FlxG.watch.addQuick('VOL', vocals.amplitudeLeft); // FlxG.watch.addQuick('VOL', vocals.amplitudeLeft);
// FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight); // FlxG.watch.addQuick('VOLRight', vocals.amplitudeRight);
iconP1.setGraphicSize(Std.int(FlxMath.lerp(150, iconP1.width, 0.85))); iconP1.setGraphicSize(Std.int(CoolUtil.coolLerp(iconP1.width, 150, 0.15)));
iconP2.setGraphicSize(Std.int(FlxMath.lerp(150, iconP2.width, 0.85))); iconP2.setGraphicSize(Std.int(CoolUtil.coolLerp(iconP2.width, 150, 0.15)));
iconP1.updateHitbox(); iconP1.updateHitbox();
iconP2.updateHitbox(); iconP2.updateHitbox();

View file

@ -93,8 +93,10 @@ class SwagCamera extends FlxCamera
else else
{ {
// THIS THE PART THAT ACTUALLY MATTERS LOL // THIS THE PART THAT ACTUALLY MATTERS LOL
scroll.x += (_scrollTarget.x - scroll.x) * CoolUtil.camLerpShit(followLerp); scroll.x = CoolUtil.coolLerp(scroll.x, _scrollTarget.x, followLerp);
scroll.y += (_scrollTarget.y - scroll.y) * CoolUtil.camLerpShit(followLerp); scroll.y = CoolUtil.coolLerp(scroll.y, _scrollTarget.y, followLerp);
// scroll.x += (_scrollTarget.x - scroll.x) * CoolUtil.camLerpShit(followLerp);
// scroll.y += (_scrollTarget.y - scroll.y) * CoolUtil.camLerpShit(followLerp);
} }
} }
} }