Fork Lifter: Pea zoom sound lines up (mostly) independent of bpm

This commit is contained in:
Jenny Crowe
2022-02-05 06:08:33 -07:00
parent 217849e666
commit dfed5a879f
5 changed files with 72 additions and 4 deletions

View File

@ -19,7 +19,12 @@ namespace RhythmHeavenMania.Games.ForkLifter
private void Start()
{
anim = GetComponent<Animator>();
Jukebox.PlayOneShotGame("forkLifter/zoom");
// SCHEDULING zoom sound so it lines up with when it meets the fork.
var currentDspTime = AudioSettings.dspTime;
var zoomStartTime = currentDspTime + (double)(Conductor.instance.secPerBeat * 2) - 0.317;
Jukebox.PlayOneShotScheduledGame("forkLifter/zoomFast", (double)zoomStartTime);
GetComponentInChildren<SpriteRenderer>().sprite = ForkLifter.instance.peaSprites[type];
for (int i = 0; i < transform.GetChild(0).childCount; i++)