Funkin/source/CoolUtil.hx

59 lines
1.3 KiB
Haxe
Raw Normal View History

2021-01-14 23:33:12 -05:00
package;
import flixel.FlxG;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
2021-04-14 11:31:52 -04:00
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxGraphicAsset;
import haxe.Json;
import lime.math.Rectangle;
2021-01-14 23:33:12 -05:00
import lime.utils.Assets;
using StringTools;
class CoolUtil
{
2021-03-01 23:00:02 -05:00
public static var difficultyArray:Array<String> = ['EASY', "NORMAL", "HARD"];
public static function difficultyString():String
{
return difficultyArray[PlayState.storyDifficulty];
}
2021-01-14 23:33:12 -05:00
public static function coolTextFile(path:String):Array<String>
{
var daList:Array<String> = Assets.getText(path).trim().split('\n');
for (i in 0...daList.length)
{
daList[i] = daList[i].trim();
}
return daList;
}
2021-01-25 05:04:31 -05:00
public static function numberArray(max:Int, ?min = 0):Array<Int>
{
var dumbArray:Array<Int> = [];
for (i in min...max)
{
dumbArray.push(i);
}
return dumbArray;
}
2021-04-04 13:17:46 -04:00
/**
Lerps camera, but accountsfor framerate shit?
Right now it's simply for use to change the followLerp variable of a camera during update
TODO LATER MAYBE:
Actually make and modify the scroll and lerp shit in it's own function
instead of solely relying on changing the lerp on the fly
*/
public static function camLerpShit(lerp:Float):Float
{
return lerp * (FlxG.elapsed / (1 / 60));
}
2021-01-14 23:33:12 -05:00
}