mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-30 13:33:07 +00:00
Merge pull request #49 from jakobwcrowe/master
BTSDS: Fine tuning for block animation timing.
This commit is contained in:
commit
314f12bccb
2 changed files with 7 additions and 4 deletions
|
@ -24,7 +24,7 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS
|
|||
{
|
||||
if (!moving) return;
|
||||
|
||||
var windupBeat = createBeat + (createLength * 3.5f);
|
||||
var windupBeat = createBeat + (createLength * 4f);
|
||||
var hitBeat = windupBeat + createLength;
|
||||
var currentBeat = Conductor.instance.songPositionInBeats;
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS
|
|||
var ev = blockEvents[i];
|
||||
if (spawnedBlockEvents.Contains(ev)) continue; // Don't spawn the same blocks multiple times.
|
||||
|
||||
var spawnBeat = ev.beat - (ev.length * 0.5f);
|
||||
var spawnBeat = ev.beat - ev.length;
|
||||
if (currentBeat > spawnBeat && currentBeat < ev.beat + ev.length)
|
||||
{
|
||||
SpawnBlocks(spawnBeat, ev.length);
|
||||
|
@ -125,18 +125,21 @@ namespace RhythmHeavenMania.Games.BuiltToScaleDS
|
|||
const int blockFramesPerSecond = 24;
|
||||
const int blockHitFrame = 39;
|
||||
const int blockTotalFrames = 80;
|
||||
const int spawnFrameOffset = -3;
|
||||
List<int> criticalFrames = new List<int> { 7, 15, 23, 31, 39, 47 };
|
||||
public void SetBlockTime(Blocks blocks, float spawnBeat, float length)
|
||||
{
|
||||
float spawnTimeOffset = (float)spawnFrameOffset / (float)blockFramesPerSecond;
|
||||
|
||||
float secondsPerFrame = 1f / blockFramesPerSecond;
|
||||
float secondsToHitFrame = secondsPerFrame * blockHitFrame;
|
||||
|
||||
float secondsPerBeat = Conductor.instance.secPerBeat;
|
||||
float secondsToHitBeat = secondsPerBeat * 4.5f * length;
|
||||
float secondsToHitBeat = secondsPerBeat * 5f * length + spawnTimeOffset;
|
||||
|
||||
float speedMult = secondsToHitFrame / secondsToHitBeat;
|
||||
|
||||
float secondsPastSpawnTime = secondsPerBeat * (Conductor.instance.songPositionInBeats - spawnBeat);
|
||||
float secondsPastSpawnTime = secondsPerBeat * (Conductor.instance.songPositionInBeats - spawnBeat) + spawnTimeOffset;
|
||||
float framesPastSpawnTime = blockFramesPerSecond * speedMult * secondsPastSpawnTime;
|
||||
|
||||
// The only way I could deal with Unity's interpolation shenanigans without having a stroke.
|
||||
|
|
Loading…
Reference in a new issue