abot positioning

This commit is contained in:
Cameron Taylor 2024-02-23 02:18:50 -05:00
parent 40a056078c
commit b261729fa3
2 changed files with 6 additions and 4 deletions

2
assets

@ -1 +1 @@
Subproject commit a681c9293fae71fee41aca51266c53ff30564a6f
Subproject commit 181e410888e7808ed373e14d539048a4ae17feea

View file

@ -28,15 +28,17 @@ class ABotVis extends FlxTypedSpriteGroup<FlxSprite>
// these are the differences in X position, from left to right
var positionX:Array<Float> = [0, 59, 56, 66, 54, 52, 51];
var positionY:Array<Float> = [0, -8, -3.5, -0.4, 0.5, 4.7, 7];
for (lol in 1...8)
{
// pushes initial value
volumes.push(0.0);
var sum = function(num:Float, total:Float) return total += num;
var posX:Float = positionX.slice(0, lol).fold(sum, 0);
var posY:Float = positionY.slice(0, lol).fold(sum, 0);
var posX:Float = positionX[lol - 1] + (positionX[lol - 2] ?? 0);
var viz:FlxSprite = new FlxSprite(posX, 0);
var viz:FlxSprite = new FlxSprite(posX, posY);
viz.frames = visFrms;
add(viz);