Fix Steps
This commit is contained in:
@ -49,7 +49,7 @@ class MusicBeatState extends FlxUIState
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
//everyStep();
|
||||
var nextStep:Int = updateCurStep();
|
||||
/*var nextStep:Int = updateCurStep();
|
||||
|
||||
if (nextStep >= 0)
|
||||
{
|
||||
@ -69,7 +69,7 @@ class MusicBeatState extends FlxUIState
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (Conductor.songPosition < 0)
|
||||
curDecimalBeat = 0;
|
||||
@ -83,17 +83,62 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
Conductor.crochet = ((60 / data.bpm) * 1000);
|
||||
|
||||
var percent = (Conductor.songPosition - (data.startTime * 1000)) / (data.length * 1000);
|
||||
var step = ((60 / data.bpm) * 1000) / 4;
|
||||
var startInMS = (data.startTime * 1000);
|
||||
|
||||
|
||||
var percent = (Conductor.songPosition - startInMS) / (data.length * 1000);
|
||||
|
||||
curDecimalBeat = data.startBeat + (((Conductor.songPosition/1000) - data.startTime) * (data.bpm / 60));
|
||||
var ste:Int = Math.floor(data.startStep + ((Conductor.songPosition - startInMS) / step));
|
||||
if (ste >= 0)
|
||||
{
|
||||
if (ste > curStep)
|
||||
{
|
||||
for (i in curStep...ste)
|
||||
{
|
||||
curStep++;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
else if (ste < curStep)
|
||||
{
|
||||
//Song reset?
|
||||
curStep = ste;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
curDecimalBeat = (Conductor.songPosition / 1000) * (Conductor.bpm/60);
|
||||
var nextStep:Int = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
|
||||
if (nextStep >= 0)
|
||||
{
|
||||
if (nextStep > curStep)
|
||||
{
|
||||
for (i in curStep...nextStep)
|
||||
{
|
||||
curStep++;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
else if (nextStep < curStep)
|
||||
{
|
||||
//Song reset?
|
||||
curStep = nextStep;
|
||||
updateBeat();
|
||||
stepHit();
|
||||
}
|
||||
}
|
||||
Conductor.crochet = ((60 / Conductor.bpm) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (FlxG.save.data.fpsRain && skippedFrames >= 6)
|
||||
{
|
||||
if (currentColor >= array.length)
|
||||
|
Reference in New Issue
Block a user