mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 11:37:40 +02:00
Crop Stomp: Basic stomping
This commit is contained in:
52
Assets/Scripts/Games/CropStomp/Farmer.cs
Normal file
52
Assets/Scripts/Games/CropStomp/Farmer.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Games.CropStomp
|
||||
{
|
||||
public class Farmer : PlayerActionObject
|
||||
{
|
||||
public float nextStompBeat;
|
||||
|
||||
private CropStomp game;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
game = CropStomp.instance;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!game.isMarching)
|
||||
return;
|
||||
|
||||
float normalizedBeat = Conductor.instance.GetPositionFromMargin(nextStompBeat, 1f);
|
||||
|
||||
StateCheck(normalizedBeat);
|
||||
|
||||
if (normalizedBeat > Minigame.LateTime())
|
||||
{
|
||||
nextStompBeat += 2f;
|
||||
ResetState();
|
||||
return;
|
||||
}
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
if (state.perfect)
|
||||
{
|
||||
game.Stomp();
|
||||
nextStompBeat += 2f;
|
||||
ResetState();
|
||||
}
|
||||
else if (state.notPerfect())
|
||||
{
|
||||
nextStompBeat += 2f;
|
||||
ResetState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user