mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-03-25 22:29:42 -04:00
mitigate countdown dancing issues (might still fuck up on higher bpm)
This commit is contained in:
parent
49d060d9f2
commit
91409b67c9
3 changed files with 47 additions and 37 deletions
|
@ -35,7 +35,7 @@ class MusicBeatState extends FlxUIState
|
|||
updateCurStep();
|
||||
updateBeat();
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
if (oldStep != curStep && curStep >= 0)
|
||||
stepHit();
|
||||
|
||||
super.update(elapsed);
|
||||
|
|
|
@ -29,7 +29,7 @@ class MusicBeatSubstate extends FlxSubState
|
|||
updateCurStep();
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
|
||||
if (oldStep != curStep && curStep > 0)
|
||||
if (oldStep != curStep && curStep >= 0)
|
||||
stepHit();
|
||||
|
||||
|
||||
|
|
|
@ -908,9 +908,18 @@ class PlayState extends MusicBeatState
|
|||
|
||||
startTimer = new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer)
|
||||
{
|
||||
dad.dance();
|
||||
gf.dance();
|
||||
boyfriend.playAnim('idle');
|
||||
// this just based on beatHit stuff but compact
|
||||
if (swagCounter % gfSpeed == 0)
|
||||
gf.dance();
|
||||
if (swagCounter % 2 == 0)
|
||||
{
|
||||
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
|
||||
boyfriend.playAnim('idle');
|
||||
if (!dad.animation.curAnim.name.startsWith("sing"))
|
||||
dad.dance();
|
||||
}
|
||||
else if (dad.curCharacter == 'spooky' && !dad.animation.curAnim.name.startsWith("sing"))
|
||||
dad.dance();
|
||||
|
||||
var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>();
|
||||
introAssets.set('default', ['ready', "set", "go"]);
|
||||
|
@ -1286,6 +1295,39 @@ class PlayState extends MusicBeatState
|
|||
iconP1.animation.play('bf-old');
|
||||
}
|
||||
|
||||
// do this BEFORE super.update() so songPosition is accurate
|
||||
if (startingSong)
|
||||
{
|
||||
if (startedCountdown)
|
||||
{
|
||||
Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
if (Conductor.songPosition >= 0)
|
||||
startSong();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Conductor.songPosition = FlxG.sound.music.time;
|
||||
Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
|
||||
if (!paused)
|
||||
{
|
||||
songTime += FlxG.game.ticks - previousFrameTime;
|
||||
previousFrameTime = FlxG.game.ticks;
|
||||
|
||||
// Interpolation type beat
|
||||
if (Conductor.lastSongPos != Conductor.songPosition)
|
||||
{
|
||||
songTime = (songTime + Conductor.songPosition) / 2;
|
||||
Conductor.lastSongPos = Conductor.songPosition;
|
||||
// Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
// trace('MISSED FRAME');
|
||||
}
|
||||
}
|
||||
|
||||
// Conductor.lastSongPos = FlxG.sound.music.time;
|
||||
}
|
||||
|
||||
switch (curStage)
|
||||
{
|
||||
case 'philly':
|
||||
|
@ -1362,38 +1404,6 @@ class PlayState extends MusicBeatState
|
|||
FlxG.switchState(new AnimationDebug(SONG.player2));
|
||||
#end
|
||||
|
||||
if (startingSong)
|
||||
{
|
||||
if (startedCountdown)
|
||||
{
|
||||
Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
if (Conductor.songPosition >= 0)
|
||||
startSong();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Conductor.songPosition = FlxG.sound.music.time;
|
||||
Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
|
||||
if (!paused)
|
||||
{
|
||||
songTime += FlxG.game.ticks - previousFrameTime;
|
||||
previousFrameTime = FlxG.game.ticks;
|
||||
|
||||
// Interpolation type beat
|
||||
if (Conductor.lastSongPos != Conductor.songPosition)
|
||||
{
|
||||
songTime = (songTime + Conductor.songPosition) / 2;
|
||||
Conductor.lastSongPos = Conductor.songPosition;
|
||||
// Conductor.songPosition += FlxG.elapsed * 1000;
|
||||
// trace('MISSED FRAME');
|
||||
}
|
||||
}
|
||||
|
||||
// Conductor.lastSongPos = FlxG.sound.music.time;
|
||||
}
|
||||
|
||||
if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null)
|
||||
{
|
||||
if (curBeat % 4 == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue