mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:17:38 +02:00
Added Tap, Double Tap, and Triple Tap to Tap Trial
All perfectly playable :) Hopefully this is up to standards with the other games I just wanted to do this to prove to myself that I could LOL
This commit is contained in:
@ -9,6 +9,9 @@ namespace RhythmHeavenMania.Games.TapTrial
|
||||
[Header("References")]
|
||||
[System.NonSerialized] public Animator anim;
|
||||
|
||||
public float nextBeat;
|
||||
public int tripleOffset = 0;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
anim = GetComponent<Animator>();
|
||||
@ -16,16 +19,39 @@ namespace RhythmHeavenMania.Games.TapTrial
|
||||
|
||||
private void Update()
|
||||
{
|
||||
float normalizedBeat = Conductor.instance.GetPositionFromMargin(nextBeat, 1f);
|
||||
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
Tap(false);
|
||||
Tap(false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void Tap(bool hit)
|
||||
public void Tap(bool hit, int type)
|
||||
{
|
||||
Jukebox.PlayOneShotGame("tapTrial/tonk");
|
||||
anim.Play("Tap", 0, 0);
|
||||
if (hit)
|
||||
Jukebox.PlayOneShotGame("tapTrial/tap");
|
||||
else
|
||||
Jukebox.PlayOneShotGame("tapTrial/tonk");
|
||||
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
anim.Play("Tap", 0, 0);
|
||||
break;
|
||||
case 1:
|
||||
anim.Play("DoubleTap", 0, 0);
|
||||
break;
|
||||
case 2:
|
||||
if(tripleOffset % 2 == 0)
|
||||
anim.Play("DoubleTap", 0, 0);
|
||||
else
|
||||
anim.Play("Tap", 0, 0);
|
||||
tripleOffset++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user