From 11ba4ac690d37a76402baccda6ef9c49d4d675e0 Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 10 Nov 2020 12:52:49 -0500 Subject: [PATCH] added lucky, highscore fix?? --- source/Character.hx | 18 +++++++++++++++++- source/Highscore.hx | 4 ++++ source/TitleState.hx | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index 937fd310c..427e7bb11 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -52,7 +52,6 @@ class Character extends FlxSprite addOffset('scared'); playAnim('danceRight'); - case 'dad': // DAD ANIMATION LOADING CODE tex = FlxAtlasFrames.fromSparrow(AssetPaths.DADDY_DEAREST__png, AssetPaths.DADDY_DEAREST__xml); @@ -103,6 +102,21 @@ class Character extends FlxSprite addOffset("singLEFT", -30); addOffset("singDOWN", -30, -40); playAnim('idle'); + case 'lucky': + tex = FlxAtlasFrames.fromSparrow(AssetPaths.lucky_guitar_assets__png, AssetPaths.lucky_guitar_assets__xml); + frames = tex; + animation.addByPrefix('idle', 'lucky guitar idle', 24); + animation.addByPrefix('singUP', 'lucky UP NOTE', 24); + animation.addByPrefix('singRIGHT', 'lucky sing right', 24); + animation.addByPrefix('singDOWN', 'lucky DOWN note', 24); + animation.addByPrefix('singLEFT', 'lucky sing left', 24); + + addOffset('idle'); + addOffset("singUP", -6, 50); + addOffset("singRIGHT", 0, 27); + addOffset("singLEFT", -10, 10); + addOffset("singDOWN", 0, -30); + playAnim('idle'); } } @@ -135,6 +149,8 @@ class Character extends FlxSprite playAnim('idle'); case 'monster': playAnim('idle'); + case 'lucky': + playAnim('idle'); } } diff --git a/source/Highscore.hx b/source/Highscore.hx index 4b14746fd..462f70d1b 100644 --- a/source/Highscore.hx +++ b/source/Highscore.hx @@ -4,7 +4,11 @@ import flixel.FlxG; class Highscore { + #if (haxe >= "4.0.0") public static var songScores:Map = new Map(); + #else + public static var songScores:Map = new Map(); + #end public static function saveScore(song:String, score:Int = 0, ?diff:Int = 0):Void { diff --git a/source/TitleState.hx b/source/TitleState.hx index 8aa74a16d..51fb8250b 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -59,7 +59,7 @@ class TitleState extends MusicBeatState super.create(); - #if (!switch && !debug && NG_LOGIN) + #if (web && !debug && NG_LOGIN) var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey); #end