diff --git a/assets/preload/images/iconGrid.png b/assets/preload/images/iconGrid.png deleted file mode 100644 index 9d3b1c059..000000000 Binary files a/assets/preload/images/iconGrid.png and /dev/null differ diff --git a/assets/preload/images/icons/icon-bf-old.png b/assets/preload/images/icons/icon-bf-old.png new file mode 100644 index 000000000..1641f9801 Binary files /dev/null and b/assets/preload/images/icons/icon-bf-old.png differ diff --git a/assets/preload/images/icons/icon-bf-pixel.png b/assets/preload/images/icons/icon-bf-pixel.png new file mode 100644 index 000000000..afe7cbecc Binary files /dev/null and b/assets/preload/images/icons/icon-bf-pixel.png differ diff --git a/assets/preload/images/icons/icon-bf.png b/assets/preload/images/icons/icon-bf.png new file mode 100644 index 000000000..921c2c39f Binary files /dev/null and b/assets/preload/images/icons/icon-bf.png differ diff --git a/assets/preload/images/icons/icon-dad.png b/assets/preload/images/icons/icon-dad.png new file mode 100644 index 000000000..f6eda3f0e Binary files /dev/null and b/assets/preload/images/icons/icon-dad.png differ diff --git a/assets/preload/images/icons/icon-face.png b/assets/preload/images/icons/icon-face.png new file mode 100644 index 000000000..24e206aa2 Binary files /dev/null and b/assets/preload/images/icons/icon-face.png differ diff --git a/assets/preload/images/icons/icon-gf.png b/assets/preload/images/icons/icon-gf.png new file mode 100644 index 000000000..440b336c6 Binary files /dev/null and b/assets/preload/images/icons/icon-gf.png differ diff --git a/assets/preload/images/icons/icon-mom.png b/assets/preload/images/icons/icon-mom.png new file mode 100644 index 000000000..520ca7af9 Binary files /dev/null and b/assets/preload/images/icons/icon-mom.png differ diff --git a/assets/preload/images/icons/icon-monster.png b/assets/preload/images/icons/icon-monster.png new file mode 100644 index 000000000..f8bc4ee4a Binary files /dev/null and b/assets/preload/images/icons/icon-monster.png differ diff --git a/assets/preload/images/icons/icon-parents.png b/assets/preload/images/icons/icon-parents.png new file mode 100644 index 000000000..44a3c40e9 Binary files /dev/null and b/assets/preload/images/icons/icon-parents.png differ diff --git a/assets/preload/images/icons/icon-pico.png b/assets/preload/images/icons/icon-pico.png new file mode 100644 index 000000000..47c94a04f Binary files /dev/null and b/assets/preload/images/icons/icon-pico.png differ diff --git a/assets/preload/images/icons/icon-senpai.png b/assets/preload/images/icons/icon-senpai.png new file mode 100644 index 000000000..5728fbdaa Binary files /dev/null and b/assets/preload/images/icons/icon-senpai.png differ diff --git a/assets/preload/images/icons/icon-spirit.png b/assets/preload/images/icons/icon-spirit.png new file mode 100644 index 000000000..0a6b8621f Binary files /dev/null and b/assets/preload/images/icons/icon-spirit.png differ diff --git a/assets/preload/images/icons/icon-spooky.png b/assets/preload/images/icons/icon-spooky.png new file mode 100644 index 000000000..e37ac3523 Binary files /dev/null and b/assets/preload/images/icons/icon-spooky.png differ diff --git a/assets/preload/images/icons/icon-tankman.png b/assets/preload/images/icons/icon-tankman.png new file mode 100644 index 000000000..50699a3b3 Binary files /dev/null and b/assets/preload/images/icons/icon-tankman.png differ diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index 9224904f1..53f404f98 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -2,6 +2,8 @@ package; import flixel.FlxSprite; +using StringTools; + class HealthIcon extends FlxSprite { /** @@ -9,37 +11,45 @@ class HealthIcon extends FlxSprite */ public var sprTracker:FlxSprite; + var char:String = 'bf'; + var isPlayer:Bool = false; + public function new(char:String = 'bf', isPlayer:Bool = false) { super(); - loadGraphic(Paths.image('iconGrid'), true, 150, 150); + this.isPlayer = isPlayer; + this.char = char; + + loadIcon(char); antialiasing = true; - animation.add('bf', [0, 1], 0, false, isPlayer); - animation.add('bf-holding-gf', [0, 1], 0, false, isPlayer); - animation.add('bf-car', [0, 1], 0, false, isPlayer); - animation.add('bf-christmas', [0, 1], 0, false, isPlayer); - animation.add('bf-pixel', [21, 21], 0, false, isPlayer); - animation.add('spooky', [2, 3], 0, false, isPlayer); - animation.add('pico', [4, 5], 0, false, isPlayer); - animation.add('pico-speaker', [4, 5], 0, false, isPlayer); - animation.add('mom', [6, 7], 0, false, isPlayer); - animation.add('mom-car', [6, 7], 0, false, isPlayer); - animation.add('tankman', [8, 9], 0, false, isPlayer); - animation.add('face', [10, 11], 0, false, isPlayer); - animation.add('dad', [12, 13], 0, false, isPlayer); - animation.add('senpai', [22, 22], 0, false, isPlayer); - animation.add('senpai-angry', [22, 22], 0, false, isPlayer); - animation.add('spirit', [23, 23], 0, false, isPlayer); - animation.add('bf-old', [14, 15], 0, false, isPlayer); - animation.add('gf', [16], 0, false, isPlayer); - animation.add('parents-christmas', [17], 0, false, isPlayer); - animation.add('monster', [19, 20], 0, false, isPlayer); - animation.add('monster-christmas', [19, 20], 0, false, isPlayer); - animation.play(char); scrollFactor.set(); } + public var isOldIcon:Bool = false; + + public function swapOldIcon():Void + { + isOldIcon = !isOldIcon; + + if (isOldIcon) + { + loadGraphic(Paths.image('icons/icon-bf-old'), true, 150, 150); + animation.add('bf-old', [0, 1], 0, false, isPlayer); + animation.play('bf-old'); + } + else + loadIcon(char); + } + + function loadIcon(char:String):Void + { + var realChar:String = char.split('-')[0].trim(); + loadGraphic(Paths.image('icons/icon-' + realChar), true, 150, 150); + animation.add(realChar, [0, 1], 0, false, isPlayer); + animation.play(realChar); + } + override function update(elapsed:Float) { super.update(elapsed); diff --git a/source/PlayState.hx b/source/PlayState.hx index fa7a6244e..971b1f651 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1389,12 +1389,7 @@ class PlayState extends MusicBeatState #end if (FlxG.keys.justPressed.NINE) - { - if (iconP1.animation.curAnim.name == 'bf-old') - iconP1.animation.play(SONG.player1); - else - iconP1.animation.play('bf-old'); - } + iconP1.swapOldIcon(); // do this BEFORE super.update() so songPosition is accurate if (startingSong)