From 4af59051000f3e449ddabfb1b6b0671cd0bb5f3f Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Wed, 14 Dec 2022 12:25:12 -0500 Subject: [PATCH] better freeplay number --- source/funkin/freeplayStuff/FreeplayScore.hx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/funkin/freeplayStuff/FreeplayScore.hx b/source/funkin/freeplayStuff/FreeplayScore.hx index cef363cd0..5fb529485 100644 --- a/source/funkin/freeplayStuff/FreeplayScore.hx +++ b/source/funkin/freeplayStuff/FreeplayScore.hx @@ -51,7 +51,7 @@ class FreeplayScore extends FlxTypedSpriteGroup 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 = ["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));