BPM map, trim off useless song stuff, adjust MILF cam zoom

This commit is contained in:
MtH
2021-02-11 23:06:26 +01:00
parent a5477c841b
commit 9b0bc41cc5
5 changed files with 74 additions and 20 deletions

View File

@ -1,5 +1,6 @@
package;
import Conductor.BPMChangeEvent;
import flixel.FlxG;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.ui.FlxUIState;
@ -38,7 +39,7 @@ class MusicBeatState extends FlxUIState
everyStep();
updateCurStep();
// Needs to be ROUNED, rather than ceil or floor
// Needs to be FLOOR idk why it was rounded but that dont make sense
updateBeat();
super.update(elapsed);
@ -46,7 +47,7 @@ class MusicBeatState extends FlxUIState
private function updateBeat():Void
{
curBeat = Math.round(curStep / 4);
curBeat = Math.floor(curStep / 4);
}
/**
@ -66,7 +67,18 @@ class MusicBeatState extends FlxUIState
private function updateCurStep():Void
{
curStep = Math.floor(Conductor.songPosition / Conductor.stepCrochet);
var lastChange:BPMChangeEvent = {
stepTime: 0,
songTime: 0,
bpm: 0
}
for (i in 0...Conductor.bpmChangeMap.length)
{
if (Conductor.songPosition >= Conductor.bpmChangeMap[i].songTime)
lastChange = Conductor.bpmChangeMap[i];
}
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
}
public function stepHit():Void