Fixed a space soccer bug that slowly desyncs

This commit is contained in:
Braedon 2022-01-26 17:23:18 -05:00
parent 8268936e6d
commit 197fbbeb7d
2 changed files with 8 additions and 3 deletions

View file

@ -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;

View file

@ -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;