1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-01 01:36:47 +00:00

seperated / cleaned up?

This commit is contained in:
Cameron Taylor 2021-09-01 23:39:37 -04:00
parent fdd28336c1
commit d108f7c39d
2 changed files with 59 additions and 29 deletions

View file

@ -29,7 +29,7 @@ class FlxAnimate extends FlxSymbol
{ {
super(x, y); super(x, y);
var folder:String = "tightBarsLol"; var folder:String = "tightestBars";
frames = FlxAnimate.fromAnimate(Paths.file('images/' + folder + "/spritemap1.png"), Paths.file('images/$folder/spritemap1.json')); frames = FlxAnimate.fromAnimate(Paths.file('images/' + folder + "/spritemap1.png"), Paths.file('images/$folder/spritemap1.json'));
@ -66,6 +66,10 @@ class FlxAnimate extends FlxSymbol
// go thru animate file to see how it should all be ordered // go thru animate file to see how it should all be ordered
// per frame symbol stuff to fix lip sync (in ParseAnimate?) // per frame symbol stuff to fix lip sync (in ParseAnimate?)
// definitely need to dig through Animate.json stuff // definitely need to dig through Animate.json stuff
// something with TRP stuff, look through tighterBars (GF scene)
// redo map stuff incase there's multiple assets
// ONE CENTRAL THING FOR THIS DUMBASS BULLSHIT
// sorted framelist put it all in there, then make i actually mean something
function actualFrameRender() function actualFrameRender()
{ {
@ -75,12 +79,16 @@ class FlxAnimate extends FlxSymbol
{ {
var spr:FlxSymbol = new FlxSymbol(0, 0); // redo this to recycle from a list later var spr:FlxSymbol = new FlxSymbol(0, 0); // redo this to recycle from a list later
spr.frames = frames; spr.frames = frames;
spr.frame = spr.frames.getByName(i); spr.frame = spr.frames.getByName(i.frameName); // this one is fine
if (FlxG.keys.justPressed.I) if (FlxG.keys.justPressed.I)
trace(ParseAnimate.theRoots.get(i) + ": " + i); {
trace(i.frameName);
trace(i.depthString);
trace("random lol: " + i.randomLol);
}
for (swagMatrix in ParseAnimate.matrixMap.get(i)) for (swagMatrix in i.matrixArray)
{ {
var alsoSwag:FlxMatrix = new FlxMatrix(swagMatrix[0], swagMatrix[1], swagMatrix[4], swagMatrix[5], swagMatrix[12], swagMatrix[13]); var alsoSwag:FlxMatrix = new FlxMatrix(swagMatrix[0], swagMatrix[1], swagMatrix[4], swagMatrix[5], swagMatrix[12], swagMatrix[13]);
spr.matrixExposed = true; spr.matrixExposed = true;

View file

@ -87,13 +87,20 @@ class ParseAnimate
*/ */
public static var depthTypeBeat:String = ""; public static var depthTypeBeat:String = "";
public static var frameList:Array<Array<String>> = []; public static var frameList:Array<Array<VALIDFRAME>> = [];
public static var matrixMap:Map<String, Array<Array<Float>>> = new Map(); public static var matrixMap:Map<String, Array<Array<Float>>> = new Map();
public static var trpMap:Map<String, Array<Array<Float>>> = new Map(); public static var trpMap:Map<String, Array<Array<Float>>> = new Map();
public static var theRoots:Map<String, String> = new Map(); public static var theRoots:Map<String, String> = new Map();
// for loop stuf // for loop stuf
public static var matrixHelp:Array<Array<Float>> = [];
/**
* Similar to frameList, keeps track of shit according to framess?
* That amount of arrays within arrays is fuckin dumb
* but innermost array is basically just x and y value, cuz im dum
*/
public static var matrixHelp:Array<Array<Array<Float>>> = [];
public static var trpHelpIDK:Array<Array<Float>> = []; public static var trpHelpIDK:Array<Array<Float>> = [];
public static var loopedFrameShit:Int = 0; public static var loopedFrameShit:Int = 0;
@ -102,6 +109,8 @@ class ParseAnimate
{ {
frameList = []; frameList = [];
frameList.push([]); frameList.push([]);
matrixHelp = [];
matrixHelp.push([]);
matrixMap.clear(); matrixMap.clear();
theRoots.clear(); theRoots.clear();
trpMap.clear(); trpMap.clear();
@ -130,7 +139,7 @@ class ParseAnimate
frameInput = 0; frameInput = 0;
var oldFrm:Int = frameInput; var oldFrm:Int = frameInput;
/*
if (curLoopType == "SF") if (curLoopType == "SF")
{ {
trace(layer.LN); trace(layer.LN);
@ -138,7 +147,7 @@ class ParseAnimate
trace(frameArray); trace(frameArray);
trace(frameInput); trace(frameInput);
trace(curLoopType); trace(curLoopType);
} }*/
if (curLoopType == "LP") if (curLoopType == "LP")
frameInput = frameArray[frameInput % frameArray.length]; frameInput = frameArray[frameInput % frameArray.length];
@ -159,16 +168,23 @@ class ParseAnimate
{ {
if (Reflect.hasField(element, "ASI")) if (Reflect.hasField(element, "ASI"))
{ {
frameList[frameList.length - 1].push(element.ASI.N); matrixHelp[matrixHelp.length - 1].push(element.ASI.M3D);
matrixHelp.push(element.ASI.M3D); // matrixMap.set(element.ASI.N, matrixHelp);
matrixMap.set(element.ASI.N, matrixHelp);
frameList[frameList.length - 1].push({
frameName: element.ASI.N,
M3D: element.ASI.M3D,
depthString: depthTypeBeat,
matrixArray: matrixHelp[matrixHelp.length - 1],
randomLol: FlxG.random.int(0, 100)
});
trpMap.set(element.ASI.N, trpHelpIDK); trpMap.set(element.ASI.N, trpHelpIDK);
// flips the matrix once?? I cant remember exactly why it needs to be flipped // flips the matrix once?? I cant remember exactly why it needs to be flipped
matrixMap.get(element.ASI.N).reverse(); // matrixMap[matrixHelp.length - 1].reverse();
// matrixHelp[matrixHelp.length - 1].reverse();
matrixHelp = [];
trpHelpIDK = []; trpHelpIDK = [];
theRoots.set(element.ASI.N, depthTypeBeat); theRoots.set(element.ASI.N, depthTypeBeat);
@ -179,7 +195,7 @@ class ParseAnimate
} }
else else
{ {
matrixHelp.push(element.SI.M3D); matrixHelp[matrixHelp.length - 1].push(element.SI.M3D);
trpHelpIDK.push([element.SI.TRP.x, element.SI.TRP.y]); trpHelpIDK.push([element.SI.TRP.x, element.SI.TRP.y]);
depthTypeBeat += "->" + element.SI.SN; depthTypeBeat += "->" + element.SI.SN;
curLoopType = element.SI.LP; curLoopType = element.SI.LP;
@ -189,7 +205,7 @@ class ParseAnimate
// JANKY FIX, MAY NOT ACCOUNT FOR ALL SCENARIOS! // JANKY FIX, MAY NOT ACCOUNT FOR ALL SCENARIOS!
if (curLoopType == "SF") if (curLoopType == "SF")
{ {
trace("LOOP SHIT: " + inputFrame); // trace("LOOP SHIT: " + inputFrame);
loopedFrameShit = inputFrame; loopedFrameShit = inputFrame;
} }
@ -198,12 +214,22 @@ class ParseAnimate
} }
frameList.push([]); frameList.push([]);
matrixHelp.push([]);
} }
frameList.reverse(); frameList.reverse();
} }
} }
typedef VALIDFRAME =
{
frameName:String,
M3D:Array<Float>,
depthString:String,
matrixArray:Array<Array<Float>>,
?randomLol:Float
}
typedef AnimJson = typedef AnimJson =
{ {
AN:Animation, AN:Animation,
@ -260,17 +286,13 @@ typedef SymbolInstance =
{ {
SN:String, SN:String,
/**Symbol type, prob either G (graphic), or movie clip?*/ /**Symbol type, prob either G (graphic), or movie clip?*/ ST:String,
ST:String,
/**First frame*/ /**First frame*/ FF:Int,
FF:Int,
/**Loop type, loop ping pong, etc.*/ /**Loop type, loop ping pong, etc.*/ LP:String,
LP:String,
/**3D matrix*/ /**3D matrix*/ M3D:Array<Float>,
M3D:Array<Float>,
TRP: TRP:
{ {