mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-02-16 20:01:49 -05:00
some timing polish
This commit is contained in:
parent
80892bd3a2
commit
06da64ac20
2 changed files with 17 additions and 8 deletions
|
@ -238,6 +238,11 @@ class FreeplayState extends MusicBeatSubstate
|
|||
funnyMenu.alpha = 0.5;
|
||||
funnyMenu.songText.visible = false;
|
||||
|
||||
new FlxTimer().start((1 / 24) * i, function(doShit)
|
||||
{
|
||||
funnyMenu.doJumpIn = true;
|
||||
});
|
||||
|
||||
new FlxTimer().start((0.09 * i) + 0.85, function(lerpTmr)
|
||||
{
|
||||
funnyMenu.doLerp = true;
|
||||
|
|
|
@ -20,6 +20,7 @@ class SongMenuItem extends FlxSpriteGroup
|
|||
|
||||
public var targetPos:FlxPoint = new FlxPoint();
|
||||
public var doLerp:Bool = false;
|
||||
public var doJumpIn:Bool = false;
|
||||
|
||||
public function new(x:Float, y:Float, song:String)
|
||||
{
|
||||
|
@ -50,17 +51,20 @@ class SongMenuItem extends FlxSpriteGroup
|
|||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
frameTicker += elapsed;
|
||||
|
||||
if (frameTicker >= 1 / 24 && frameTypeBeat < xFrames.length)
|
||||
if (doJumpIn)
|
||||
{
|
||||
frameTicker = 0;
|
||||
frameTicker += elapsed;
|
||||
|
||||
scale.x = xFrames[frameTypeBeat];
|
||||
scale.y = 1 / xFrames[frameTypeBeat];
|
||||
x = FlxG.width * xPosLerpLol[Std.int(Math.min(frameTypeBeat, xPosLerpLol.length - 1))];
|
||||
if (frameTicker >= 1 / 24 && frameTypeBeat < xFrames.length)
|
||||
{
|
||||
frameTicker = 0;
|
||||
|
||||
frameTypeBeat += 1;
|
||||
scale.x = xFrames[frameTypeBeat];
|
||||
scale.y = 1 / xFrames[frameTypeBeat];
|
||||
x = FlxG.width * xPosLerpLol[Std.int(Math.min(frameTypeBeat, xPosLerpLol.length - 1))];
|
||||
|
||||
frameTypeBeat += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (doLerp)
|
||||
|
|
Loading…
Reference in a new issue