Files
CodenameEngine/source/funkin/backend/system/FunkinGame.hx
T
2023-04-22 02:52:02 +02:00

20 lines
542 B
Haxe

package funkin.backend.system;
import flixel.FlxGame;
class FunkinGame extends FlxGame {
var skipNextTickUpdate:Bool = false;
public override function switchState() {
super.switchState();
// draw once to put all images in gpu then put the last update time to now to prevent lag spikes or whatever
draw();
_total = ticks = getTicks();
skipNextTickUpdate = true;
}
public override function onEnterFrame(t) {
if (skipNextTickUpdate != (skipNextTickUpdate = false))
_total = ticks = getTicks();
super.onEnterFrame(t);
}
}