fix steps reseting in gameplay
This commit is contained in:
parent
e09957267c
commit
b2fef2db49
@ -101,6 +101,7 @@ class MusicBeatState extends FlxUIState
|
|||||||
}
|
}
|
||||||
else if (ste < curStep)
|
else if (ste < curStep)
|
||||||
{
|
{
|
||||||
|
trace("reset steps for some reason?? at " + Conductor.songPosition);
|
||||||
//Song reset?
|
//Song reset?
|
||||||
curStep = ste;
|
curStep = ste;
|
||||||
updateBeat();
|
updateBeat();
|
||||||
@ -126,6 +127,7 @@ class MusicBeatState extends FlxUIState
|
|||||||
else if (nextStep < curStep)
|
else if (nextStep < curStep)
|
||||||
{
|
{
|
||||||
//Song reset?
|
//Song reset?
|
||||||
|
trace("(no bpm change) reset steps for some reason?? at " + Conductor.songPosition);
|
||||||
curStep = nextStep;
|
curStep = nextStep;
|
||||||
updateBeat();
|
updateBeat();
|
||||||
stepHit();
|
stepHit();
|
||||||
|
@ -2226,36 +2226,42 @@ class PlayState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateFrame == 4)
|
if (updateFrame == 4)
|
||||||
{
|
{
|
||||||
TimingStruct.clearTimings();
|
TimingStruct.clearTimings();
|
||||||
|
|
||||||
var currentIndex = 0;
|
var currentIndex = 0;
|
||||||
for (i in SONG.eventObjects)
|
for (i in SONG.eventObjects)
|
||||||
{
|
|
||||||
if (i.type == "BPM Change")
|
|
||||||
{
|
{
|
||||||
var beat:Float = i.position;
|
if (i.type == "BPM Change")
|
||||||
|
|
||||||
var endBeat:Float = Math.POSITIVE_INFINITY;
|
|
||||||
|
|
||||||
TimingStruct.addTiming(beat,i.value,endBeat, 0); // offset in this case = start time since we don't have a offset
|
|
||||||
|
|
||||||
if (currentIndex != 0)
|
|
||||||
{
|
{
|
||||||
var data = TimingStruct.AllTimings[currentIndex - 1];
|
var beat:Float = i.position;
|
||||||
data.endBeat = beat;
|
|
||||||
data.length = (data.endBeat - data.startBeat) / (data.bpm / 60);
|
var endBeat:Float = Math.POSITIVE_INFINITY;
|
||||||
TimingStruct.AllTimings[currentIndex].startTime = data.startTime + data.length;
|
|
||||||
|
TimingStruct.addTiming(beat,i.value,endBeat, 0); // offset in this case = start time since we don't have a offset
|
||||||
|
|
||||||
|
if (currentIndex != 0)
|
||||||
|
{
|
||||||
|
var data = TimingStruct.AllTimings[currentIndex - 1];
|
||||||
|
data.endBeat = beat;
|
||||||
|
data.length = (data.endBeat - data.startBeat) / (data.bpm / 60);
|
||||||
|
var step = ((60 / data.bpm) * 1000) / 4;
|
||||||
|
TimingStruct.AllTimings[currentIndex].startStep = Math.floor(((data.endBeat / (data.bpm / 60)) * 1000) / step);
|
||||||
|
TimingStruct.AllTimings[currentIndex].startTime = data.startTime + data.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentIndex++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
recalculateAllSectionTimes();
|
||||||
|
|
||||||
|
regenerateLines();
|
||||||
|
updateFrame++;
|
||||||
|
}
|
||||||
|
else if (updateFrame != 5)
|
||||||
updateFrame++;
|
updateFrame++;
|
||||||
}
|
|
||||||
else if (updateFrame != 5)
|
|
||||||
updateFrame++;
|
|
||||||
|
|
||||||
|
|
||||||
var timingSeg = TimingStruct.getTimingAtTimestamp(Conductor.songPosition);
|
var timingSeg = TimingStruct.getTimingAtTimestamp(Conductor.songPosition);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user