fixed issue with desync

This commit is contained in:
Cameron Taylor 2020-10-16 04:15:17 -07:00
parent 78ec82d953
commit 33385ddd15
2 changed files with 4 additions and 14 deletions

View File

@ -47,7 +47,6 @@ class MusicBeatState extends FlxUIState
private function updateCurStep():Void private function updateCurStep():Void
{ {
Conductor.songPosition = FlxG.sound.music.time;
curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet); curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
} }

View File

@ -260,28 +260,20 @@ class PlayState extends MusicBeatState
var playerCounter:Int = 0; var playerCounter:Int = 0;
var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped var daBeats:Int = 0; // Not exactly representative of 'daBeats' lol, just how much it has looped
var totalLength:Int = 0; // Total length of the song, in beats;
for (section in noteData) for (section in noteData)
{ {
var dumbassSection:Array<Dynamic> = section.notes;
var coolSection:Int = Std.int(section.lengthInSteps / 4); var coolSection:Int = Std.int(section.lengthInSteps / 4);
if (coolSection <= 4) // FIX SINCE MOST THE SHIT I MADE WERE ONLY 3 HTINGS LONG LOl for (songNotes in section.notes)
coolSection = 4;
else if (coolSection <= 8)
coolSection = 8;
for (songNotes in dumbassSection)
{ {
sectionScores[0].push(0); sectionScores[0].push(0);
sectionScores[1].push(0); sectionScores[1].push(0);
var daStrumTime:Float = songNotes[0] + (Conductor.stepCrochet * section.lengthInSteps); var daStrumTime:Float = songNotes[0];
trace(daStrumTime); trace(daStrumTime);
var daNoteData:Int = songNotes[1]; var daNoteData:Int = songNotes[1];
var daStrumTime:Float = daStrumTime; // var daStrumTime:Float = daStrumTime;
var oldNote:Note; var oldNote:Note;
if (unspawnNotes.length > 0) if (unspawnNotes.length > 0)
@ -298,7 +290,7 @@ class PlayState extends MusicBeatState
if (swagNote.mustPress) if (swagNote.mustPress)
{ {
swagNote.x += (FlxG.width / 2); // general offset swagNote.x += FlxG.width / 2; // general offset
} }
else else
{ {
@ -323,7 +315,6 @@ class PlayState extends MusicBeatState
if (section.mustHitSection) if (section.mustHitSection)
sectionLengths.push(Math.round(coolSection / 4)); sectionLengths.push(Math.round(coolSection / 4));
*/ */
totalLength += Math.round(coolSection / 4);
daBeats += 1; daBeats += 1;
} }