Added Support for specific direction inputs

Added some comments on the PlayerInput class too for clarity
This commit is contained in:
Pengu123
2022-05-04 18:42:06 +02:00
parent 846e4c5c4c
commit 8911581873
4 changed files with 87 additions and 10 deletions

View File

@ -77,13 +77,26 @@ namespace HeavenStudio.Games
public bool IsCorrectInput()
{
// This one is a mouthful but it's an evil good to detect the correct input
// Forgive me for those input type names
return (
//General inputs, both down and up
(PlayerInput.Pressed() && inputType == InputType.STANDARD_DOWN) ||
(PlayerInput.AltPressed() && inputType == InputType.STANDARD_ALT_DOWN) ||
(PlayerInput.GetAnyDirectionDown() && inputType == InputType.DIRECTION_DOWN) ||
(PlayerInput.PressedUp() && inputType == InputType.STANDARD_UP) ||
(PlayerInput.AltPressedUp() && inputType == InputType.STANDARD_ALT_UP) ||
(PlayerInput.GetAnyDirectionUp() && inputType == InputType.DIRECTION_UP)
(PlayerInput.GetAnyDirectionUp() && inputType == InputType.DIRECTION_UP) ||
//Specific directional inputs
(PlayerInput.GetSpecificDirectionDown(PlayerInput.DOWN) && inputType == InputType.DIRECTION_DOWN_DOWN) ||
(PlayerInput.GetSpecificDirectionDown(PlayerInput.UP) && inputType == InputType.DIRECTION_UP_DOWN) ||
(PlayerInput.GetSpecificDirectionDown(PlayerInput.LEFT) && inputType == InputType.DIRECTION_LEFT_DOWN) ||
(PlayerInput.GetSpecificDirectionDown(PlayerInput.RIGHT) && inputType == InputType.DIRECTION_RIGHT_DOWN) ||
(PlayerInput.GetSpecificDirectionUp(PlayerInput.DOWN) && inputType == InputType.DIRECTION_DOWN_UP) ||
(PlayerInput.GetSpecificDirectionUp(PlayerInput.UP) && inputType == InputType.DIRECTION_UP_UP) ||
(PlayerInput.GetSpecificDirectionUp(PlayerInput.LEFT) && inputType == InputType.DIRECTION_LEFT_UP) ||
(PlayerInput.GetSpecificDirectionUp(PlayerInput.RIGHT) && inputType == InputType.DIRECTION_RIGHT_UP)
);
}