1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-10 00:34:40 +00:00

totalSteps & totalBeats synced with bpm changes

This commit is contained in:
MtH 2021-02-12 01:58:11 +01:00
parent 674a08b381
commit f3462c2c99
3 changed files with 13 additions and 34 deletions

View file

@ -36,10 +36,14 @@ class MusicBeatState extends FlxUIState
override function update(elapsed:Float)
{
everyStep();
//everyStep();
var oldStep:Int = curStep;
updateCurStep();
// Needs to be FLOOR idk why it was rounded but that dont make sense
if (oldStep != curStep && curStep > 0)
stepHit();
updateBeat();
super.update(elapsed);
@ -50,21 +54,6 @@ class MusicBeatState extends FlxUIState
curBeat = Math.floor(curStep / 4);
}
/**
* CHECKS EVERY FRAME
*/
private function everyStep():Void
{
if (Conductor.songPosition > lastStep + Conductor.stepCrochet - Conductor.safeZoneOffset
|| Conductor.songPosition < lastStep + Conductor.safeZoneOffset)
{
if (Conductor.songPosition > lastStep + Conductor.stepCrochet)
{
stepHit();
}
}
}
private function updateCurStep():Void
{
var lastChange:BPMChangeEvent = {

View file

@ -35,29 +35,19 @@ class MusicBeatSubstate extends FlxSubState
override function update(elapsed:Float)
{
everyStep();
//everyStep();
var oldStep:Int = curStep;
updateCurStep();
if (oldStep != curStep && curStep > 0)
stepHit();
curBeat = Math.floor(curStep / 4);
super.update(elapsed);
}
/**
* CHECKS EVERY FRAME
*/
private function everyStep():Void
{
if (Conductor.songPosition > lastStep + Conductor.stepCrochet - Conductor.safeZoneOffset
|| Conductor.songPosition < lastStep + Conductor.safeZoneOffset)
{
if (Conductor.songPosition > lastStep + Conductor.stepCrochet)
{
stepHit();
}
}
}
private function updateCurStep():Void
{
var lastChange:BPMChangeEvent = {

View file

@ -2261,7 +2261,6 @@ class PlayState extends MusicBeatState
override function beatHit()
{
wiggleShit.update(Conductor.crochet);
super.beatHit();
if (generatedMusic)
@ -2284,6 +2283,7 @@ class PlayState extends MusicBeatState
dad.dance();
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);
// HARDCODING FOR MILF ZOOMS!
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)