mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-23 16:17:53 -05:00
31 lines
701 B
Haxe
31 lines
701 B
Haxe
package;
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
class Character extends FlxSprite
|
|
{
|
|
public var animOffsets:Map<String, Array<Dynamic>>;
|
|
public var debugMode:Bool = false;
|
|
|
|
public function new(x:Float, y:Float)
|
|
{
|
|
animOffsets = new Map<String, Array<Dynamic>>();
|
|
super(x, y);
|
|
}
|
|
|
|
public function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
|
|
{
|
|
animation.play(AnimName, Force, Reversed, Frame);
|
|
|
|
var daOffset = animOffsets.get(animation.curAnim.name);
|
|
if (animOffsets.exists(animation.curAnim.name))
|
|
{
|
|
offset.set(daOffset[0], daOffset[1]);
|
|
}
|
|
}
|
|
|
|
public function addOffset(name:String, x:Float = 0, y:Float = 0)
|
|
{
|
|
animOffsets[name] = [x, y];
|
|
}
|
|
}
|