From a6fcba54c1b9844454e7052c8fb9ec7af9e5d6ed Mon Sep 17 00:00:00 2001 From: Braedon Date: Wed, 26 Jan 2022 17:23:18 -0500 Subject: [PATCH] Fixed a space soccer bug that slowly desyncs --- Assets/Scripts/Games/SpaceSoccer/Ball.cs | 10 +++++++--- Assets/Scripts/Games/SpaceSoccer/Kicker.cs | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Games/SpaceSoccer/Ball.cs b/Assets/Scripts/Games/SpaceSoccer/Ball.cs index b8f24163c..693ffbd29 100644 --- a/Assets/Scripts/Games/SpaceSoccer/Ball.cs +++ b/Assets/Scripts/Games/SpaceSoccer/Ball.cs @@ -22,7 +22,7 @@ namespace RhythmHeavenMania.Games.SpaceSoccer [Header("Properties")] public float dispensedBeat = 0; public bool dispensing; - public int hitTimes; + public float hitTimes; private float lastSpriteRot; public bool canKick; public GameEvent kicked = new GameEvent(); @@ -38,8 +38,8 @@ namespace RhythmHeavenMania.Games.SpaceSoccer dispensing = false; kicked.enabled = true; - kicked.startBeat = Conductor.instance.songPositionInBeats; - // kicked.startBeat = dispensedBeat + 2 + hitTimes; + // kicked.startBeat = Conductor.instance.songPositionInBeats; + kicked.startBeat = dispensedBeat + 2 + hitTimes; hitTimes++; @@ -58,6 +58,8 @@ namespace RhythmHeavenMania.Games.SpaceSoccer public void HighKick() { + hitTimes += 1.5f; + lastSpriteRot = spriteHolder.transform.eulerAngles.z; dispensing = false; @@ -70,6 +72,8 @@ namespace RhythmHeavenMania.Games.SpaceSoccer public void Toe() { + hitTimes += 1.5f; + lastSpriteRot = spriteHolder.transform.eulerAngles.z; highKicked.enabled = false; diff --git a/Assets/Scripts/Games/SpaceSoccer/Kicker.cs b/Assets/Scripts/Games/SpaceSoccer/Kicker.cs index c3e39fd4f..380bf4f6d 100644 --- a/Assets/Scripts/Games/SpaceSoccer/Kicker.cs +++ b/Assets/Scripts/Games/SpaceSoccer/Kicker.cs @@ -171,6 +171,7 @@ namespace RhythmHeavenMania.Games.SpaceSoccer { if ((highKicks[i].beat - 0.15f) <= Conductor.instance.songPositionInBeats && highKicks[i].beat + 1f > Conductor.instance.songPositionInBeats) { + print("bruh"); canHighKick = true; canKick = false; break;