mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-11-27 01:03:35 +00:00
animation playback wip
This commit is contained in:
parent
8524f244c7
commit
75c1cbdbd3
|
@ -45,10 +45,33 @@ class FlxAnimate extends FlxSymbol
|
|||
|
||||
// notes to self
|
||||
// account for different layers
|
||||
var playingAnim:Bool = false;
|
||||
var frameTickTypeShit:Float = 0;
|
||||
var animFrameRate:Int = 24;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (FlxG.keys.justPressed.SPACE)
|
||||
playingAnim = !playingAnim;
|
||||
|
||||
if (playingAnim)
|
||||
{
|
||||
frameTickTypeShit += elapsed;
|
||||
|
||||
// prob fix this framerate thing for higher framerates?
|
||||
if (frameTickTypeShit >= 1 / 24)
|
||||
{
|
||||
changeFrame(1);
|
||||
frameTickTypeShit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
changeFrame(1);
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
changeFrame(-1);
|
||||
}
|
||||
|
||||
// This stuff is u
|
||||
|
|
|
@ -8,6 +8,8 @@ class FlxSymbol extends FlxSprite
|
|||
public var coolParse:Parsed;
|
||||
public var oldMatrix:Array<Float> = [];
|
||||
|
||||
private var hasFrameByPass:Bool = false;
|
||||
|
||||
public function new(x:Float, y:Float, coolParsed:Parsed)
|
||||
{
|
||||
super(x, y);
|
||||
|
@ -34,20 +36,22 @@ class FlxSymbol extends FlxSprite
|
|||
|
||||
var drawQueue:Array<FlxSymbol> = [];
|
||||
|
||||
public var daFrame:Int = 0;
|
||||
|
||||
function renderFrame(TL:Timeline, coolParsed:Parsed, ?isMainLoop:Bool = false)
|
||||
{
|
||||
drawQueue = [];
|
||||
|
||||
for (layer in TL.L)
|
||||
{
|
||||
var frameInfo:Frame = layer.FR[0];
|
||||
// layer.FR.reverse();
|
||||
// var frame = layer.FR[0]
|
||||
|
||||
if (isMainLoop)
|
||||
frameInfo = layer.FR[0];
|
||||
|
||||
// frameInfo.E.reverse();
|
||||
|
||||
for (element in frameInfo.E)
|
||||
for (frame in layer.FR)
|
||||
{
|
||||
if (daFrame >= frame.I && daFrame < frame.I + frame.DU)
|
||||
{
|
||||
for (element in frame.E)
|
||||
{
|
||||
if (Reflect.hasField(element, 'ASI'))
|
||||
{
|
||||
|
@ -101,21 +105,6 @@ class FlxSymbol extends FlxSprite
|
|||
else
|
||||
{
|
||||
var nestedSymbol = symbolMap.get(element.SI.SN);
|
||||
// trace(element.SI.M3D[12]);
|
||||
// swagX = x +;
|
||||
// swagY =;
|
||||
|
||||
if (oldMatrix != null)
|
||||
{
|
||||
// x += oldMatrix[12];
|
||||
// y += oldMatrix[13];
|
||||
}
|
||||
|
||||
// if (symbolAtlasShit.exists(nestedSymbol.SN))
|
||||
// {
|
||||
// nestedShit.frames.getByName(symbolAtlasShit.get(nestedSymbol.SN));
|
||||
// nestedShit.draw();
|
||||
// }
|
||||
|
||||
// nestedSymbol
|
||||
|
||||
|
@ -137,17 +126,26 @@ class FlxSymbol extends FlxSprite
|
|||
|
||||
nestedShit.angle = FlxAngle.asDegrees(Math.atan2(_matrix.b, _matrix.a));
|
||||
|
||||
if (symbolAtlasShit.exists(nestedSymbol.SN))
|
||||
{
|
||||
// nestedShit.frames.getByName(symbolAtlasShit.get(nestedSymbol.SN));
|
||||
// nestedShit.draw();
|
||||
}
|
||||
|
||||
// scale.y = Math.sqrt(_matrix.c * _matrix.c + _matrix.d * _matrix.d);
|
||||
// scale.x = Math.sqrt(_matrix.a * _matrix.a + _matrix.b * _matrix.b);
|
||||
|
||||
// nestedShit.oldMatrix = element.SI.M3D;
|
||||
|
||||
nestedShit.hasFrameByPass = true;
|
||||
nestedShit.renderFrame(nestedSymbol.TL, coolParsed);
|
||||
|
||||
// renderFrame(nestedSymbol.TL, coolParsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// drawQueue.reverse();
|
||||
//
|
||||
|
@ -155,6 +153,11 @@ class FlxSymbol extends FlxSprite
|
|||
thing.draw();
|
||||
}
|
||||
|
||||
function changeFrame(frameChange:Int = 0):Void
|
||||
{
|
||||
daFrame += frameChange;
|
||||
}
|
||||
|
||||
function parseSymbolDictionary(coolParsed:Parsed):Map<String, String>
|
||||
{
|
||||
var awesomeMap:Map<String, String> = new Map();
|
||||
|
|
Loading…
Reference in a new issue