From 22504b8d34e16458b937e88806a0de1b48b41e95 Mon Sep 17 00:00:00 2001 From: Jenny Crowe Date: Wed, 16 Feb 2022 19:19:40 -0700 Subject: [PATCH] BTSDS: Added some sfx + slight margin tweak --- .../Sfx/games/builtToScaleDS/Boing.ogg.meta | 22 +++++++++++++++++++ .../Sfx/games/builtToScaleDS/Sink.ogg.meta | 22 +++++++++++++++++++ Assets/Scripts/Games/BuiltToScaleDS/Blocks.cs | 16 +++++++++++--- .../Games/BuiltToScaleDS/BuiltToScaleDS.cs | 1 + 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 Assets/Resources/Sfx/games/builtToScaleDS/Boing.ogg.meta create mode 100644 Assets/Resources/Sfx/games/builtToScaleDS/Sink.ogg.meta diff --git a/Assets/Resources/Sfx/games/builtToScaleDS/Boing.ogg.meta b/Assets/Resources/Sfx/games/builtToScaleDS/Boing.ogg.meta new file mode 100644 index 00000000..e427d2aa --- /dev/null +++ b/Assets/Resources/Sfx/games/builtToScaleDS/Boing.ogg.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 7c6d6633ba3aa5145a2029c497163951 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/Sfx/games/builtToScaleDS/Sink.ogg.meta b/Assets/Resources/Sfx/games/builtToScaleDS/Sink.ogg.meta new file mode 100644 index 00000000..57094602 --- /dev/null +++ b/Assets/Resources/Sfx/games/builtToScaleDS/Sink.ogg.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1c864d88c41ff32418c61277cb9743dd +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Games/BuiltToScaleDS/Blocks.cs b/Assets/Scripts/Games/BuiltToScaleDS/Blocks.cs index 04ecb15b..9bde159a 100644 --- a/Assets/Scripts/Games/BuiltToScaleDS/Blocks.cs +++ b/Assets/Scripts/Games/BuiltToScaleDS/Blocks.cs @@ -36,7 +36,7 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS game.shooterAnim.Play("Windup", 0, 0); } - float stateBeat = Conductor.instance.GetPositionFromMargin(createBeat + (createLength * 4.5f), 1f); + float stateBeat = Conductor.instance.GetPositionFromMargin(hitBeat, 2f); StateCheck(stateBeat); if (PlayerInput.Pressed()) @@ -51,9 +51,19 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS } } - if (moving && anim.GetCurrentAnimatorStateInfo(0).normalizedTime < 0.9f) + if (moving) { - game.SetBlockTime(this, createBeat, createLength); + var sinkBeat = hitBeat + (createLength * 2f); + + if (currentBeat < sinkBeat) + { + game.SetBlockTime(this, createBeat, createLength); + } + else + { + moving = false; + Jukebox.PlayOneShotGame("builtToScaleDS/Sink"); + } } } diff --git a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs index 2b895b8a..06c3d901 100644 --- a/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs +++ b/Assets/Scripts/Games/BuiltToScaleDS/BuiltToScaleDS.cs @@ -98,6 +98,7 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS shootingThisFrame = true; Shoot(); SpawnObject(BTSObject.FlyingRod); + Jukebox.PlayOneShotGame("builtToScaleDS/Boing"); } if (!shootingThisFrame)