mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-25 22:47:52 +00:00
MAYBE DOIN CHART SHIT?
This commit is contained in:
parent
8c8f234fb3
commit
cb0ebfdbe1
|
@ -384,6 +384,8 @@ class ChartingState extends MusicBeatState
|
|||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
curStep = recalculateSteps();
|
||||
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
_song.song = typingShit.text;
|
||||
|
||||
|
@ -520,6 +522,28 @@ class ChartingState extends MusicBeatState
|
|||
super.update(elapsed);
|
||||
}
|
||||
|
||||
function recalculateSteps():Int
|
||||
{
|
||||
var steps:Int = 0;
|
||||
var timeShit:Float = 0;
|
||||
|
||||
for (i in 0...curSection)
|
||||
{
|
||||
steps += 16;
|
||||
|
||||
if (_song.notes[i].changeBPM)
|
||||
timeShit += (((60 / _song.notes[i].bpm) * 1000) / 4) * 16;
|
||||
else
|
||||
timeShit += (((60 / _song.bpm) * 1000) / 4) * 16;
|
||||
}
|
||||
|
||||
steps += Math.floor((FlxG.sound.music.time - timeShit) / Conductor.stepCrochet);
|
||||
curStep = steps;
|
||||
updateBeat();
|
||||
|
||||
return curStep;
|
||||
}
|
||||
|
||||
function changeSection(sec:Int = 0, ?updateMusic:Bool = true):Void
|
||||
{
|
||||
trace('changing section' + sec);
|
||||
|
|
|
@ -35,11 +35,16 @@ class MusicBeatState extends FlxUIState
|
|||
|
||||
updateCurStep();
|
||||
// Needs to be ROUNED, rather than ceil or floor
|
||||
curBeat = Math.round(curStep / 4);
|
||||
updateBeat();
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
private function updateBeat():Void
|
||||
{
|
||||
curBeat = Math.round(curStep / 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* CHECKS EVERY FRAME
|
||||
*/
|
||||
|
|
|
@ -68,7 +68,7 @@ class TitleState extends MusicBeatState
|
|||
}
|
||||
|
||||
#if SKIP_TO_PLAYSTATE
|
||||
FlxG.switchState(new FreeplayState());
|
||||
FlxG.switchState(new ChartingState());
|
||||
#else
|
||||
startIntro();
|
||||
#end
|
||||
|
|
Loading…
Reference in a new issue