Skip to content

Commit

Permalink
fix for #12
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjamuffin99 committed Nov 18, 2020
1 parent c48f957 commit ff649ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/MusicBeatState.hx
Expand Up @@ -64,6 +64,13 @@ class MusicBeatState extends FlxUIState
totalSteps += 1;
lastStep += Conductor.stepCrochet;

// If the song is at least 3 steps behind
if (Conductor.songPosition > lastStep + (Conductor.stepCrochet * 3))
{
lastStep = Conductor.songPosition;
totalSteps = Math.round(lastStep / Conductor.stepCrochet);
}

if (totalSteps % 4 == 0)
beatHit();
}
Expand Down

0 comments on commit ff649ae

Please sign in to comment.