Auto-Swing (#827)

* BurstLinq

make BGM resync when changing pitch (to test)

* autoswing

some game implementations, most games already work fine

* more game tweaks

* 16th note swing

more game fixes
make pitch change resync optional in the API

* suppress some common warnings

* Update Credits.txt
This commit is contained in:
minenice55
2024-04-07 00:54:06 -04:00
committed by GitHub
parent ff4b3523af
commit d32f5591d2
49 changed files with 2363 additions and 245 deletions

View File

@ -168,6 +168,8 @@ namespace HeavenStudio.Games
public int stepIterate = 0;
private static double startSteppingBeat = double.MaxValue;
private static double startBlippingBeat = double.MaxValue;
private string currentMetronomeDir = "Right";
private static double metronomeBeat = double.MaxValue;
private bool stopStepping;
public bool stopBlipping;
@ -241,6 +243,16 @@ namespace HeavenStudio.Games
man.RecursiveBlipping(startBlippingBeat);
startBlippingBeat = double.MaxValue;
}
if (songPos > metronomeBeat + 1)
{
metronomeAnim.Play("MetronomeGo" + currentMetronomeDir, -1, 1);
metronomeAnim.speed = 0;
}
else if (songPos >= metronomeBeat)
{
metronomeAnim.DoScaledAnimation("MetronomeGo" + currentMetronomeDir, metronomeBeat, 1, ignoreSwing: false);
}
}
}
@ -291,9 +303,9 @@ namespace HeavenStudio.Games
stopStepping = false;
return;
}
string dir = (stepIterate % 2 == 1) ? "Right" : "Left";
metronomeAnim.DoScaledAnimationAsync("MetronomeGo" + dir, 0.5f);
SoundByte.PlayOneShotGame("mrUpbeat/metronome" + dir);
currentMetronomeDir = (stepIterate % 2 == 1) ? "Right" : "Left";
SoundByte.PlayOneShotGame($"mrUpbeat/metronome{currentMetronomeDir}");
metronomeBeat = beat;
ScheduleStep(beat);
BeatAction.New(this, new List<BeatAction.Action>() {
new(beat + 1, delegate { RecursiveStepping(beat + 1); })
@ -306,11 +318,11 @@ namespace HeavenStudio.Games
var actions = new List<BeatAction.Action>();
for (int i = 0; i < length; i++)
{
ScheduleStep(beat);
ScheduleStep(beat + i);
actions.Add(new BeatAction.Action(beat + i, delegate {
string dir = (stepIterate % 2 == 1) ? "Right" : "Left";
metronomeAnim.DoScaledAnimationAsync("MetronomeGo" + dir, 0.5f);
SoundByte.PlayOneShotGame("mrUpbeat/metronome" + dir);
currentMetronomeDir = (stepIterate % 2 == 1) ? "Right" : "Left";
SoundByte.PlayOneShotGame($"mrUpbeat/metronome{currentMetronomeDir}");
metronomeBeat = beat + i;
stepIterate++;
}));
}