diff --git a/assets/images/campaign_menu_UI_characters.png b/assets/images/campaign_menu_UI_characters.png index 75de6a500..1efc44db7 100644 Binary files a/assets/images/campaign_menu_UI_characters.png and b/assets/images/campaign_menu_UI_characters.png differ diff --git a/assets/images/campaign_menu_UI_characters.xml b/assets/images/campaign_menu_UI_characters.xml index 31fa75474..114f53307 100644 --- a/assets/images/campaign_menu_UI_characters.xml +++ b/assets/images/campaign_menu_UI_characters.xml @@ -2,78 +2,104 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/source/MenuCharacter.hx b/source/MenuCharacter.hx index bb72700f6..6835daa9a 100644 --- a/source/MenuCharacter.hx +++ b/source/MenuCharacter.hx @@ -17,6 +17,7 @@ class MenuCharacter extends FlxSprite frames = tex; animation.addByPrefix('bf', "BF idle dance white", 24); + animation.addByPrefix('bfConfirm', 'BF HEY!!', 24, false); 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); diff --git a/source/MenuItem.hx b/source/MenuItem.hx index 5e7ddc763..5aae4ee28 100644 --- a/source/MenuItem.hx +++ b/source/MenuItem.hx @@ -8,6 +8,7 @@ import flixel.math.FlxMath; class MenuItem extends FlxSpriteGroup { public var targetY:Float = 0; + public var week:FlxSprite; public function new(x:Float, y:Float, weekNum:Int = 0, unlocked:Bool = false) { @@ -15,13 +16,14 @@ class MenuItem extends FlxSpriteGroup var tex = FlxAtlasFrames.fromSparrow(AssetPaths.campaign_menu_UI_assets__png, AssetPaths.campaign_menu_UI_assets__xml); - var week:FlxSprite = new FlxSprite(); + week = new FlxSprite(); week.frames = tex; week.animation.addByPrefix('week0', "WEEK1 select", 24); week.animation.addByPrefix('week1', "week2 select", 24); add(week); week.animation.play('week' + weekNum); + week.animation.pause(); week.updateHitbox(); if (!unlocked) diff --git a/source/PlayState.hx b/source/PlayState.hx index 9f4784dfb..d72fdde23 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -35,6 +35,8 @@ class PlayState extends MusicBeatState { public static var curLevel:String = 'Bopeebo'; public static var SONG:SwagSong; + public static var isStoryMode:Bool = false; + public static var storyPlaylist:Array = []; private var vocals:FlxSound; @@ -278,7 +280,8 @@ class PlayState extends MusicBeatState lastReportedPlayheadPosition = 0; startingSong = false; - FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt); + FlxG.sound.playMusic("assets/music/" + SONG.song + "_Inst" + TitleState.soundExt, 1, false); + FlxG.sound.music.onComplete = endSong; vocals.play(); } @@ -606,9 +609,9 @@ class PlayState extends MusicBeatState case 112: gfSpeed = 1; case 163: - FlxG.sound.music.stop(); - curLevel = 'Bopeebo'; - FlxG.switchState(new TitleState()); + // FlxG.sound.music.stop(); + // curLevel = 'Bopeebo'; + // FlxG.switchState(new TitleState()); } } @@ -617,9 +620,9 @@ class PlayState extends MusicBeatState switch (totalBeats) { case 127: - FlxG.sound.music.stop(); - curLevel = 'Fresh'; - FlxG.switchState(new PlayState()); + // FlxG.sound.music.stop(); + // curLevel = 'Fresh'; + // FlxG.switchState(new PlayState()); } } // better streaming of shit @@ -714,6 +717,28 @@ class PlayState extends MusicBeatState keyShit(); } + function endSong():Void + { + trace('SONG DONE' + isStoryMode); + + if (isStoryMode) + { + storyPlaylist.remove(storyPlaylist[0]); + + if (storyPlaylist.length <= 0) + { + FlxG.switchState(new TitleState()); + } + else + { + PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase()); + FlxG.switchState(new PlayState()); + } + } + } + + var endingSong:Bool = false; + private function popUpScore(strumtime:Float):Void { var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition); @@ -1131,22 +1156,25 @@ class PlayState extends MusicBeatState notes.sort(FlxSort.byY, FlxSort.DESCENDING); } - FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); - if (SONG.notes[Std.int(curStep / 16)].changeBPM) + if (SONG.notes[Math.floor(curStep / 16)] != null) { - Conductor.changeBPM(SONG.notes[Std.int(curStep / 16)].bpm); - FlxG.log.add('CHANGED BPM!'); + if (SONG.notes[Math.floor(curStep / 16)].changeBPM) + { + Conductor.changeBPM(SONG.notes[Math.floor(curStep / 16)].bpm); + FlxG.log.add('CHANGED BPM!'); + } + else + Conductor.changeBPM(SONG.bpm); + + // Dad doesnt interupt his own notes + if (SONG.notes[Math.floor(curStep / 16)].mustHitSection) + dad.dance(); } - else - Conductor.changeBPM(SONG.bpm); + // FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM); if (camZooming && FlxG.camera.zoom < 1.35 && totalBeats % 4 == 0) FlxG.camera.zoom += 0.025; - // Dad doesnt interupt his own notes - if (SONG.notes[Std.int(curStep / 16)].mustHitSection) - dad.dance(); - healthHeads.setGraphicSize(Std.int(healthHeads.width + 20)); if (totalBeats % gfSpeed == 0) diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index a30de402e..a98b49bfb 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -6,6 +6,7 @@ import flixel.graphics.frames.FlxAtlasFrames; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup; import flixel.text.FlxText; +import flixel.util.FlxTimer; using StringTools; @@ -13,7 +14,7 @@ class StoryMenuState extends MusicBeatState { var scoreText:FlxText; - var weekData:Array = [['Tutorial', 'Bopeebo', 'Fresh', 'Dad Battle'], ['Spookeez', 'South', 'Monster']]; + var weekData:Array = [['Tutorial', 'Bopeebo', 'Fresh', 'Dadbattle'], ['Spookeez', 'South', 'Monster']]; var weekUnlocked:Array = [true, false]; var weekCharacters:Array = [['dad', 'bf', 'gf'], ['spooky', 'bf', 'gf']]; var curWeek:Int = 0; @@ -151,14 +152,40 @@ class StoryMenuState extends MusicBeatState lock.y = grpWeekText.members[lock.ID].y; }); - if (controls.UP_P) - changeWeek(-1); - if (controls.DOWN_P) - changeWeek(1); + if (!selectedWeek) + { + if (controls.UP_P) + changeWeek(-1); + if (controls.DOWN_P) + changeWeek(1); + } + + if (controls.ACCEPT) + selectWeek(); super.update(elapsed); } + var selectedWeek:Bool = false; + + function selectWeek() + { + if (weekUnlocked[curWeek]) + { + grpWeekText.members[curWeek].week.animation.resume(); + grpWeekCharacters.members[1].animation.play('bfConfirm'); + + PlayState.storyPlaylist = weekData[curWeek]; + PlayState.isStoryMode = true; + selectedWeek = true; + PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase()); + new FlxTimer().start(1, function(tmr:FlxTimer) + { + FlxG.switchState(new PlayState()); + }); + } + } + function changeWeek(change:Int = 0):Void { curWeek += change; @@ -181,6 +208,9 @@ class StoryMenuState extends MusicBeatState function updateText() { + grpWeekCharacters.members[0].animation.play(weekCharacters[curWeek][0]); + grpWeekCharacters.members[1].animation.play(weekCharacters[curWeek][1]); + grpWeekCharacters.members[2].animation.play(weekCharacters[curWeek][2]); txtTracklist.text = "Tracks\n"; var stringThing:Array = weekData[curWeek];