diff --git a/source/Controls.hx b/source/Controls.hx index 697082bd6..e59da6d5f 100644 --- a/source/Controls.hx +++ b/source/Controls.hx @@ -11,6 +11,7 @@ import flixel.input.gamepad.FlxGamepadButton; import flixel.input.gamepad.FlxGamepadInputID; import flixel.input.keyboard.FlxKey; +#if (haxe >= "4.0.0") enum abstract Action(String) to String from String { var UP = "up"; @@ -30,6 +31,28 @@ enum abstract Action(String) to String from String var PAUSE = "pause"; var RESET = "reset"; } +#else +@:enum +abstract Action(String) to String from String +{ + var UP = "up"; + var LEFT = "left"; + var RIGHT = "right"; + var DOWN = "down"; + var UP_P = "up-press"; + var LEFT_P = "left-press"; + var RIGHT_P = "right-press"; + var DOWN_P = "down-press"; + var UP_R = "up-release"; + var LEFT_R = "left-release"; + var RIGHT_R = "right-release"; + var DOWN_R = "down-release"; + var ACCEPT = "accept"; + var BACK = "back"; + var PAUSE = "pause"; + var RESET = "reset"; +} +#end enum Device { diff --git a/source/MenuCharacter.hx b/source/MenuCharacter.hx new file mode 100644 index 000000000..bb72700f6 --- /dev/null +++ b/source/MenuCharacter.hx @@ -0,0 +1,27 @@ +package; + +import flixel.FlxSprite; +import flixel.graphics.frames.FlxAtlasFrames; + +class MenuCharacter extends FlxSprite +{ + public var character:String; + + public function new(x:Float, character:String = 'bf') + { + super(x); + + this.character = character; + + var tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_characters__png, AssetPaths.campaign_menu_UI_characters__xml); + frames = tex; + + animation.addByPrefix('bf', "BF idle dance white", 24); + animation.addByPrefix('gf', "GF Dancing Beat WHITE", 24); + animation.addByPrefix('dad', "Dad idle dance BLACK LINE", 24); + animation.addByPrefix('spooky', "spooky dance idle BLACK LINES", 24); + + animation.play(character); + updateHitbox(); + } +} diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index bae5703c0..a30de402e 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -15,12 +15,13 @@ class StoryMenuState extends MusicBeatState var weekData:Array = [['Tutorial', 'Bopeebo', 'Fresh', 'Dad Battle'], ['Spookeez', 'South', 'Monster']]; var weekUnlocked:Array = [true, false]; - + var weekCharacters:Array = [['dad', 'bf', 'gf'], ['spooky', 'bf', 'gf']]; var curWeek:Int = 0; var txtTracklist:FlxText; var grpWeekText:FlxTypedGroup; + var grpWeekCharacters:FlxTypedGroup; var grpLocks:FlxTypedGroup; @@ -30,14 +31,12 @@ class StoryMenuState extends MusicBeatState { scoreText = new FlxText(10, 10, 0, "SCORE: 49324858", 36); scoreText.setFormat("VCR OSD Mono", 32); - add(scoreText); var rankText:FlxText = new FlxText(0, 10); rankText.text = 'RANK: GREAT'; rankText.setFormat("assets/fonts/vcr.ttf", 32); rankText.size = scoreText.size; rankText.screenCenter(X); - add(rankText); var ui_tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_assets__png, AssetPaths.campaign_menu_UI_assets__xml); var yellowBG:FlxSprite = new FlxSprite(0, 56).makeGraphic(FlxG.width, 400, 0xFFF9CF51); @@ -45,6 +44,8 @@ class StoryMenuState extends MusicBeatState grpWeekText = new FlxTypedGroup(); add(grpWeekText); + grpWeekCharacters = new FlxTypedGroup(); + grpLocks = new FlxTypedGroup(); add(grpLocks); @@ -76,6 +77,28 @@ class StoryMenuState extends MusicBeatState } } + for (char in 0...3) + { + var weekCharacterThing:MenuCharacter = new MenuCharacter((FlxG.width * 0.25) * (1 + char) - 150, weekCharacters[curWeek][char]); + weekCharacterThing.y += 70; + weekCharacterThing.antialiasing = true; + switch (weekCharacterThing.character) + { + case 'dad': + weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.5)); + weekCharacterThing.updateHitbox(); + + case 'bf': + weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.9)); + weekCharacterThing.updateHitbox(); + case 'gf': + weekCharacterThing.setGraphicSize(Std.int(weekCharacterThing.width * 0.5)); + weekCharacterThing.updateHitbox(); + } + + grpWeekCharacters.add(weekCharacterThing); + } + difficultySelectors = new FlxGroup(); add(difficultySelectors); @@ -100,12 +123,15 @@ class StoryMenuState extends MusicBeatState difficultySelectors.add(rightArrow); add(yellowBG); + add(grpWeekCharacters); txtTracklist = new FlxText(FlxG.width * 0.05, yellowBG.x + yellowBG.height + 100, 0, "Tracks", 32); txtTracklist.alignment = CENTER; txtTracklist.font = rankText.font; txtTracklist.color = 0xFFe55777; add(txtTracklist); + add(rankText); + add(scoreText); updateText();