mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-27 01:55:52 -05:00
totalSteps & totalBeats synced with bpm changes
This commit is contained in:
parent
674a08b381
commit
f3462c2c99
3 changed files with 13 additions and 34 deletions
|
@ -36,10 +36,14 @@ class MusicBeatState extends FlxUIState
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
everyStep();
|
//everyStep();
|
||||||
|
var oldStep:Int = curStep;
|
||||||
|
|
||||||
updateCurStep();
|
updateCurStep();
|
||||||
// Needs to be FLOOR idk why it was rounded but that dont make sense
|
|
||||||
|
if (oldStep != curStep && curStep > 0)
|
||||||
|
stepHit();
|
||||||
|
|
||||||
updateBeat();
|
updateBeat();
|
||||||
|
|
||||||
super.update(elapsed);
|
super.update(elapsed);
|
||||||
|
@ -50,21 +54,6 @@ class MusicBeatState extends FlxUIState
|
||||||
curBeat = Math.floor(curStep / 4);
|
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
|
private function updateCurStep():Void
|
||||||
{
|
{
|
||||||
var lastChange:BPMChangeEvent = {
|
var lastChange:BPMChangeEvent = {
|
||||||
|
|
|
@ -35,29 +35,19 @@ class MusicBeatSubstate extends FlxSubState
|
||||||
|
|
||||||
override function update(elapsed:Float)
|
override function update(elapsed:Float)
|
||||||
{
|
{
|
||||||
everyStep();
|
//everyStep();
|
||||||
|
var oldStep:Int = curStep;
|
||||||
|
|
||||||
updateCurStep();
|
updateCurStep();
|
||||||
|
|
||||||
|
if (oldStep != curStep && curStep > 0)
|
||||||
|
stepHit();
|
||||||
|
|
||||||
curBeat = Math.floor(curStep / 4);
|
curBeat = Math.floor(curStep / 4);
|
||||||
|
|
||||||
super.update(elapsed);
|
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
|
private function updateCurStep():Void
|
||||||
{
|
{
|
||||||
var lastChange:BPMChangeEvent = {
|
var lastChange:BPMChangeEvent = {
|
||||||
|
|
|
@ -2261,7 +2261,6 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
override function beatHit()
|
override function beatHit()
|
||||||
{
|
{
|
||||||
wiggleShit.update(Conductor.crochet);
|
|
||||||
super.beatHit();
|
super.beatHit();
|
||||||
|
|
||||||
if (generatedMusic)
|
if (generatedMusic)
|
||||||
|
@ -2284,6 +2283,7 @@ class PlayState extends MusicBeatState
|
||||||
dad.dance();
|
dad.dance();
|
||||||
}
|
}
|
||||||
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
|
||||||
|
wiggleShit.update(Conductor.crochet);
|
||||||
|
|
||||||
// HARDCODING FOR MILF ZOOMS!
|
// HARDCODING FOR MILF ZOOMS!
|
||||||
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)
|
if (curSong.toLowerCase() == 'milf' && curBeat >= 168 && curBeat < 200 && camZooming && FlxG.camera.zoom < 1.35)
|
||||||
|
|
Loading…
Reference in a new issue