better freeplay number

This commit is contained in:
Cameron Taylor 2022-12-14 12:25:12 -05:00
parent 6a01c3008c
commit 4af5905100

View file

@ -51,7 +51,7 @@ class FreeplayScore extends FlxTypedSpriteGroup<ScoreNum>
for (i in 0...7)
{
add(new ScoreNum(x + (45 * i), y, 0));
add(new ScoreNum(x + (35 * i), y, 0));
}
this.scoreShit = scoreShit;
@ -69,13 +69,15 @@ class ScoreNum extends FlxSprite
function set_digit(val):Int
{
if (animation.curAnim != null && animation.curAnim.name != Std.string(val))
if (animation.curAnim != null && animation.curAnim.name != numToString[val])
{
animation.play(Std.string(val), true, false, 0);
animation.play(numToString[val], true, false, 0);
updateHitbox();
switch (val)
{
case 1:
offset.x -= 15;
case 5:
// set offsets
// offset.x += 0;
@ -98,6 +100,8 @@ class ScoreNum extends FlxSprite
public var baseY:Float = 0;
public var baseX:Float = 0;
var numToString:Array<String> = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"];
public function new(x:Float, y:Float, ?initDigit:Int = 0)
{
super(x, y);
@ -105,17 +109,17 @@ class ScoreNum extends FlxSprite
baseY = y;
baseX = x;
frames = Paths.getSparrowAtlas('noteComboNumbers');
frames = Paths.getSparrowAtlas('digital_numbers');
for (i in 0...10)
{
var stringNum:String = Std.string(i);
var stringNum:String = numToString[i];
animation.addByPrefix(stringNum, stringNum, 24, false);
}
this.digit = initDigit;
animation.play(Std.string(digit), true);
animation.play(numToString[digit], true);
antialiasing = true;
setGraphicSize(Std.int(width * 0.3));