mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-25 19:15:16 +00:00
More comments, new method to detect expected inputs
IsExpectingInputNow() detects wether the player is expected to input something at the closest InputEvent
This commit is contained in:
parent
5cdd044154
commit
0b79779b9b
2 changed files with 21 additions and 1 deletions
|
@ -68,6 +68,7 @@ namespace HeavenStudio.Games
|
||||||
return evt;
|
return evt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Clean up method used whenever a PlayerActionEvent has finished
|
||||||
public void RemoveScheduledInput(PlayerActionEvent evt)
|
public void RemoveScheduledInput(PlayerActionEvent evt)
|
||||||
{
|
{
|
||||||
scheduledInputs.Remove(evt);
|
scheduledInputs.Remove(evt);
|
||||||
|
@ -98,6 +99,19 @@ namespace HeavenStudio.Games
|
||||||
return closest;
|
return closest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Hasn't been tested yet. *Should* work.
|
||||||
|
//Can be used to detect if the user is expected to input something now or not
|
||||||
|
//Useful for strict call and responses games like Tambourine
|
||||||
|
public bool IsExpectingInputNow()
|
||||||
|
{
|
||||||
|
PlayerActionEvent input = GetClosestScheduledInput();
|
||||||
|
if (input == null) return false;
|
||||||
|
|
||||||
|
return input.IsExpectingInputNow();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// hopefully these will fix the lowbpm problem
|
// hopefully these will fix the lowbpm problem
|
||||||
public static float EarlyTime()
|
public static float EarlyTime()
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,6 +88,12 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsExpectingInputNow()
|
||||||
|
{
|
||||||
|
float normalizedBeat = Conductor.instance.GetPositionFromBeat(startBeat, timer);
|
||||||
|
return normalizedBeat > Minigame.EarlyTime() && normalizedBeat < Minigame.EndTime();
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsCorrectInput()
|
public bool IsCorrectInput()
|
||||||
{
|
{
|
||||||
// This one is a mouthful but it's an evil good to detect the correct input
|
// This one is a mouthful but it's an evil good to detect the correct input
|
||||||
|
|
Loading…
Reference in a new issue