Added Mr. Upbeat fall animation

This commit is contained in:
Carson Kompon
2022-03-06 12:34:54 -05:00
parent 6bc221d185
commit bc9bac4ab5
5 changed files with 522 additions and 54 deletions

View File

@ -17,7 +17,7 @@ namespace RhythmHeavenMania.Games.MrUpbeat
public GameEvent beat = new GameEvent();
public GameEvent offbeat = new GameEvent();
public bool canGo = false;
private int beatCount = 0;
public int beatCount = 0;
public static MrUpbeat instance;
@ -26,13 +26,15 @@ namespace RhythmHeavenMania.Games.MrUpbeat
instance = this;
}
private void Start()
{
canGo = false;
man.stepTimes = 0;
SetInterval(0);
}
private void Update()
{
if (canGo)
metronome.transform.eulerAngles = new Vector3(0, 0, 270 - Mathf.Cos(Mathf.PI * Conductor.instance.songPositionInBeats) * 75);
//else
// metronome.transform.eulerAngles = new Vector3(0, 0, 200);
List<Beatmap.Entity> gos = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "mrUpbeat/go");
for(int i=0; i<gos.Count; i++)
{
@ -46,6 +48,11 @@ namespace RhythmHeavenMania.Games.MrUpbeat
}
}
if (canGo)
{
metronome.transform.eulerAngles = new Vector3(0, 0, 270 - Mathf.Cos(Mathf.PI * Conductor.instance.songPositionInBeats) * 75);
}
if (Conductor.instance.ReportBeat(ref beat.lastReportedBeat) && canGo)
{
if(beatCount % 2 == 0)
@ -63,14 +70,6 @@ namespace RhythmHeavenMania.Games.MrUpbeat
}
}
public override void OnGameSwitch()
{
base.OnGameSwitch();
canGo = false;
man.stepTimes = 0;
SetInterval(0);
}
public void SetInterval(float beat)
{
beatCount = 0;

View File

@ -29,7 +29,10 @@ namespace RhythmHeavenMania.Games.MrUpbeat
if(game.canGo && normalizedBeat > Minigame.LateTime())
{
//Fall();
if ((game.beatCount % 2 == 0 && stepTimes % 2 == 0) || (game.beatCount % 2 == 1 && stepTimes % 2 == 1))
{
Fall();
}
targetBeat += 100f;
return;
}