diff --git a/assets/preload/data/offsettest/offsettest.json b/assets/preload/data/offsettest/offsettest.json new file mode 100644 index 0000000..52325bb --- /dev/null +++ b/assets/preload/data/offsettest/offsettest.json @@ -0,0 +1 @@ +{"song":{"song":"offsetTest","notes":[{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[9600,0,0],[10800,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[12000,0,0],[13200,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[14400,0,0],[15600,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[16800,0,0],[18000,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[19200,2,0],[20400,1,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[21600,2,0],[22800,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[24000,2,0],[25200,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[26400,2,0],[27600,1,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[28800,0,0],[30000,2,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[31200,1,0],[32400,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[33600,0,0],[34800,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[36000,1,0],[37200,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[38400,1,0],[39000,1,0],[39600,2,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[40800,1,0],[41400,1,0],[42000,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[43200,1,0],[43800,1,0],[44400,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[45600,1,0],[46200,1,0],[46800,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[48000,1,0],[48300,2,0],[48600,3,0],[48900,2,0],[49800,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[50400,1,0],[50700,2,0],[51000,3,0],[51300,2,0],[52200,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[52800,3,0],[53400,1,0],[54000,0,0],[54600,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[55200,2,0],[55800,3,0],[56400,0,0],[57000,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[57600,1,750]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]}],"bpm":100,"sections":0,"needsVoices":false,"player1":"bf","player2":"gf","sectionLengths":[],"speed":1},"bpm":100,"sections":27,"notes":[{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[9600,0,0],[10800,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[12000,0,0],[13200,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[14400,0,0],[15600,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[16800,0,0],[18000,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[19200,2,0],[20400,1,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[21600,2,0],[22800,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[24000,2,0],[25200,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[26400,2,0],[27600,1,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[28800,0,0],[30000,2,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[31200,1,0],[32400,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[33600,0,0],[34800,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[36000,1,0],[37200,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[38400,1,0],[39000,1,0],[39600,2,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[40800,1,0],[41400,1,0],[42000,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[43200,1,0],[43800,1,0],[44400,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[45600,1,0],[46200,1,0],[46800,3,0]]},{"mustHitSection":false,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[48000,1,0],[48300,2,0],[48600,3,0],[48900,2,0],[49800,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[50400,1,0],[50700,2,0],[51000,3,0],[51300,2,0],[52200,3,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[52800,3,0],[53400,1,0],[54000,0,0],[54600,1,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[55200,2,0],[55800,3,0],[56400,0,0],[57000,2,0]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[[57600,1,750]]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]},{"mustHitSection":true,"typeOfSection":0,"lengthInSteps":16,"sectionNotes":[]}]} \ No newline at end of file diff --git a/assets/songs/offsettest/Inst.mp3 b/assets/songs/offsettest/Inst.mp3 new file mode 100644 index 0000000..473f008 Binary files /dev/null and b/assets/songs/offsettest/Inst.mp3 differ diff --git a/assets/songs/offsettest/Inst.ogg b/assets/songs/offsettest/Inst.ogg new file mode 100644 index 0000000..0da4490 Binary files /dev/null and b/assets/songs/offsettest/Inst.ogg differ diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 3b9b096..f622cb7 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -217,7 +217,6 @@ class FreeplayState extends MusicBeatState PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase()); PlayState.isStoryMode = false; PlayState.storyDifficulty = curDifficulty; - PlayState.storyWeek = songs[curSelected].week; trace('CUR WEEK' + PlayState.storyWeek); LoadingState.loadAndSwitchState(new PlayState()); @@ -272,6 +271,7 @@ class FreeplayState extends MusicBeatState #end #if PRELOAD_ALL + Conductor.changeBPM(Song.loadFromJson(Highscore.formatSong(songs[curSelected].songName,0),songs[curSelected].songName.toLowerCase()).bpm); FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0); #end diff --git a/source/HealthIcon.hx b/source/HealthIcon.hx index f8b9f18..af1608d 100644 --- a/source/HealthIcon.hx +++ b/source/HealthIcon.hx @@ -12,7 +12,7 @@ class HealthIcon extends FlxSprite public function new(char:String = 'bf', isPlayer:Bool = false) { super(); - trace(Paths.image('iconGrid','data')); + loadGraphic(Paths.image('iconGrid'), true, 150, 150); antialiasing = true; diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index a5b9d00..458de55 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -51,6 +51,9 @@ class KadeEngineData if (FlxG.save.data.scrollSpeed == null) FlxG.save.data.scrollSpeed = 1; + if (FlxG.save.data.npsDisplay == null) + FlxG.save.data.npsDisplay = false; + (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); } } diff --git a/source/LatencyState.hx b/source/LatencyState.hx deleted file mode 100644 index 1136330..0000000 --- a/source/LatencyState.hx +++ /dev/null @@ -1,74 +0,0 @@ -package; - -import flixel.FlxG; -import flixel.FlxSprite; -import flixel.FlxState; -import flixel.group.FlxGroup.FlxTypedGroup; -import flixel.text.FlxText; - -class LatencyState extends FlxState -{ - var offsetText:FlxText; - var noteGrp:FlxTypedGroup; - var strumLine:FlxSprite; - - override function create() - { - FlxG.sound.playMusic(Paths.sound('soundTest')); - - noteGrp = new FlxTypedGroup(); - add(noteGrp); - - for (i in 0...32) - { - var note:Note = new Note(Conductor.crochet * i, 1); - noteGrp.add(note); - } - - offsetText = new FlxText(); - offsetText.screenCenter(); - add(offsetText); - - strumLine = new FlxSprite(FlxG.width / 2, 100).makeGraphic(FlxG.width, 5); - add(strumLine); - - Conductor.changeBPM(120); - - super.create(); - } - - override function update(elapsed:Float) - { - offsetText.text = "Offset: " + Conductor.offset + "ms"; - - Conductor.songPosition = FlxG.sound.music.time - Conductor.offset; - - var multiply:Float = 1; - - if (FlxG.keys.pressed.SHIFT) - multiply = 10; - - if (FlxG.keys.justPressed.RIGHT) - Conductor.offset += 1 * multiply; - if (FlxG.keys.justPressed.LEFT) - Conductor.offset -= 1 * multiply; - - if (FlxG.keys.justPressed.SPACE) - { - FlxG.sound.music.stop(); - - FlxG.resetState(); - } - - noteGrp.forEach(function(daNote:Note) - { - daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * 0.45); - daNote.x = strumLine.x + 30; - - if (daNote.y < strumLine.y) - daNote.kill(); - }); - - super.update(elapsed); - } -} diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 77df9aa..afe4f3f 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -24,6 +24,8 @@ class MusicBeatState extends FlxUIState override function create() { + (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); + if (transIn != null) trace('reg ' + transIn.region); @@ -69,6 +71,7 @@ class MusicBeatState extends FlxUIState private function updateBeat():Void { + lastBeat = curStep; curBeat = Math.floor(curStep / 4); } diff --git a/source/Note.hx b/source/Note.hx index 92d9390..c5de613 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -169,7 +169,7 @@ class Note extends FlxSprite prevNote.animation.play('redhold'); } - prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed; + prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.8 * PlayState.SONG.speed; prevNote.updateHitbox(); // prevNote.setGraphicSize(); } diff --git a/source/Options.hx b/source/Options.hx index f9f6c42..db8d4b1 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -255,6 +255,27 @@ class RainbowFPSOption extends Option } } +class NPSDisplayOption extends Option +{ + public function new(desc:String) + { + super(); + description = desc; + } + + public override function press():Bool + { + FlxG.save.data.npsDisplay = !FlxG.save.data.npsDisplay; + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return "NPS Display " + (!FlxG.save.data.npsDisplay ? "off" : "on"); + } +} + class ReplayOption extends Option { public function new(desc:String) @@ -297,3 +318,33 @@ class CustomizeGameplay extends Option } } +class OffsetMenu extends Option +{ + public function new(desc:String) + { + super(); + description = desc; + } + + public override function press():Bool + { + trace("switch"); + var poop:String = Highscore.formatSong("offsetTest", 1); + + PlayState.SONG = Song.loadFromJson(poop, "offsetTest"); + PlayState.isStoryMode = false; + PlayState.storyDifficulty = 0; + PlayState.storyWeek = 0; + trace('CUR WEEK' + PlayState.storyWeek); + LoadingState.loadAndSwitchState(new PlayState()); + return false; + } + + private override function updateDisplay():String + { + return "Time your offset"; + } +} + + + diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 785c0c1..5b4ca64 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -23,14 +23,16 @@ class OptionsMenu extends MusicBeatState new OptionCatagory("Gameplay", [ new DFJKOption(controls), new FPSCapOption("Cap your FPS (Left for -10, Right for -10)"), - new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference"), - new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)") + new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)"), + new OffsetMenu("Get a note offset based off of your inputs!"), + new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference") ]), new OptionCatagory("Appearence", [ new SongPositionOption("Show the songs current position (as a bar)"), new DownscrollOption("Change the layout of the strumline."), new RainbowFPSOption("Make the FPS Counter Rainbow (Only works with the FPS Counter toggeled on)"), - new AccuracyOption("Display accuracy information.") + new AccuracyOption("Display accuracy information."), + new NPSDisplayOption("Shows your current Notes Per Second.") ]), new OptionCatagory("Misc", [ new EtternaModeOption("Harder Hit Windows and a different scoring system."), @@ -147,10 +149,10 @@ class OptionsMenu extends MusicBeatState versionShit.text = "Current Scroll Speed: " + FlxG.save.data.scrollSpeed + " - Description - " + currentDescription; default: if (FlxG.keys.pressed.RIGHT) - FlxG.save.data.offset++; + FlxG.save.data.offset += 0.1; if (FlxG.keys.pressed.LEFT) - FlxG.save.data.offset--; + FlxG.save.data.offset -= 0.1; versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription; } diff --git a/source/PlayState.hx b/source/PlayState.hx index f3be8eb..251fa9f 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -124,6 +124,10 @@ class PlayState extends MusicBeatState private var camHUD:FlxCamera; private var camGame:FlxCamera; + + var notesHitArray:Array = []; + var currentFrames:Int = 0; + var dialogue:Array = ['blah blah blah', 'coolswag']; var halloweenBG:FlxSprite; @@ -823,6 +827,8 @@ class PlayState extends MusicBeatState scoreTxt.x = healthBarBG.x + healthBarBG.width / 2; scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); scoreTxt.scrollFactor.set(); + if (SONG.song.contains('offsetTest')) + scoreTxt.x += 300; add(scoreTxt); replayTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (FlxG.save.data.downscroll ? 100 : -100), 0, "REPLAY", 20); @@ -1476,12 +1482,10 @@ class PlayState extends MusicBeatState ranking = "(MFC)"; else if (misses == 0 && bads == 0 && shits == 0 && goods >= 1) // Good Full Combo (Nothing but Goods & Sicks) ranking = "(GFC)"; - else if ((shits < 10 && shits != 0) && misses == 0) // Single Digit Combo Breaks - ranking = "(SDCB)"; - else if (misses == 0 && (shits >= 10)) // Regular FC + else if (misses == 0) // Regular FC ranking = "(FC)"; - else if (misses >= 10 || (shits >= 10)) // Combo Breaks - ranking = "(CB)"; + else if (misses < 10) // Single Digit Combo Breaks + ranking = "(SDCB)"; else ranking = "(Clear)"; @@ -1564,6 +1568,21 @@ class PlayState extends MusicBeatState perfectMode = false; #end + if (currentFrames == FlxG.save.data.fpsCap) + { + for(i in 0...notesHitArray.length) + { + var cock:Date = notesHitArray[i]; + if (cock != null) + if (cock.getTime() + 2000 < Date.now().getTime()) + notesHitArray.remove(cock); + } + nps = Math.floor(notesHitArray.length / 2); + currentFrames = 0; + } + else + currentFrames++; + if (FlxG.keys.justPressed.NINE) { if (iconP1.animation.curAnim.name == 'bf-old') @@ -1590,13 +1609,21 @@ class PlayState extends MusicBeatState super.update(elapsed); - if (FlxG.save.data.accuracyDisplay) + if (!SONG.song.contains('offsetTest')) { - scoreTxt.text = "Score:" + (FlxG.save.data.etternaMode ? Math.max(0,etternaModeScore) + " (" + songScore + ")" : "" + songScore) + " | Combo Breaks:" + misses + " | Accuracy:" + truncateFloat(accuracy, 2) + "% | " + generateRanking(); + if (FlxG.save.data.accuracyDisplay) + { + scoreTxt.text = (FlxG.save.data.npsDisplay ? "NPS: " + nps + " | " : "") + "Score:" + (FlxG.save.data.etternaMode ? Math.max(0,etternaModeScore) + " (" + songScore + ")" : "" + songScore) + " | Combo Breaks:" + misses + " | Accuracy:" + truncateFloat(accuracy, 2) + "% | " + generateRanking(); + } + else + { + scoreTxt.text = (FlxG.save.data.npsDisplay ? "NPS: " + nps + " | " : "") + "Score:" + songScore; + } } else { - scoreTxt.text = "Score:" + songScore; + scoreTxt.text = "Suggested Offset: " + offsetTest; + } if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause) { @@ -1940,77 +1967,89 @@ class PlayState extends MusicBeatState #end } - if (isStoryMode) + if (SONG.song.contains('offsetTest')) { - campaignScore += Math.round(songScore); - - storyPlaylist.remove(storyPlaylist[0]); - - if (storyPlaylist.length <= 0) - { - FlxG.sound.playMusic(Paths.music('freakyMenu')); - - transIn = FlxTransitionableState.defaultTransIn; - transOut = FlxTransitionableState.defaultTransOut; - - FlxG.switchState(new StoryMenuState()); - - // if () - StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true; - - if (SONG.validScore) - { - NGio.unlockMedal(60961); - Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); - } - - FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; - FlxG.save.flush(); - } - else - { - var difficulty:String = ""; - - if (storyDifficulty == 0) - difficulty = '-easy'; - - if (storyDifficulty == 2) - difficulty = '-hard'; - - trace('LOADING NEXT SONG'); - trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty); - - if (SONG.song.toLowerCase() == 'eggnog') - { - var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, - -FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK); - blackShit.scrollFactor.set(); - add(blackShit); - camHUD.visible = false; - - FlxG.sound.play(Paths.sound('Lights_Shut_off')); - } - - FlxTransitionableState.skipNextTransIn = true; - FlxTransitionableState.skipNextTransOut = true; - prevCamFollow = camFollow; - - PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]); - FlxG.sound.music.stop(); - - LoadingState.loadAndSwitchState(new PlayState()); - } + FlxG.sound.playMusic(Paths.music('freakyMenu')); + LoadingState.loadAndSwitchState(new OptionsMenu()); + FlxG.save.data.offset = offsetTest; } else { - trace('WENT BACK TO FREEPLAY??'); - FlxG.switchState(new FreeplayState()); + if (isStoryMode) + { + campaignScore += Math.round(songScore); + + storyPlaylist.remove(storyPlaylist[0]); + + if (storyPlaylist.length <= 0) + { + FlxG.sound.playMusic(Paths.music('freakyMenu')); + + transIn = FlxTransitionableState.defaultTransIn; + transOut = FlxTransitionableState.defaultTransOut; + + FlxG.switchState(new StoryMenuState()); + + // if () + StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true; + + if (SONG.validScore) + { + NGio.unlockMedal(60961); + Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); + } + + FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; + FlxG.save.flush(); + } + else + { + var difficulty:String = ""; + + if (storyDifficulty == 0) + difficulty = '-easy'; + + if (storyDifficulty == 2) + difficulty = '-hard'; + + trace('LOADING NEXT SONG'); + trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty); + + if (SONG.song.toLowerCase() == 'eggnog') + { + var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, + -FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK); + blackShit.scrollFactor.set(); + add(blackShit); + camHUD.visible = false; + + FlxG.sound.play(Paths.sound('Lights_Shut_off')); + } + + FlxTransitionableState.skipNextTransIn = true; + FlxTransitionableState.skipNextTransOut = true; + prevCamFollow = camFollow; + + PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]); + FlxG.sound.music.stop(); + + LoadingState.loadAndSwitchState(new PlayState()); + } + } + else + { + trace('WENT BACK TO FREEPLAY??'); + FlxG.switchState(new FreeplayState()); + } } } var endingSong:Bool = false; + var hits:Array = []; + var offsetTest:Float = 0; + var timeShown = 0; var currentTimingShown:FlxText = null; @@ -2130,6 +2169,18 @@ class PlayState extends MusicBeatState currentTimingShown.text = msTiming + "ms"; currentTimingShown.size = 20; + if (msTiming >= 0.03 && SONG.song.contains('offsetTest')) + { + hits.push(msTiming); + + var total = 0.0; + + for(i in hits) + total += i; + + offsetTest = truncateFloat(total / hits.length,2); + } + if (currentTimingShown.alpha != 1) currentTimingShown.alpha = 1; @@ -2800,6 +2851,8 @@ class PlayState extends MusicBeatState } } + var nps:Int = 0; + function goodNoteHit(note:Note, resetMashViolation = true):Void { @@ -2814,6 +2867,9 @@ class PlayState extends MusicBeatState else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44) note.rating = "sick"; + if (!note.isSustainNote) + notesHitArray.push(Date.now()); + if (resetMashViolation) mashViolations--;