Attack should fie if threshold is reached

Either we need to modify the getInput example (as it will not trigger the attack by default):

if(digitalRead(attackButtonPinNumber) == HIGH) joystickWobble = ATTACK_THRESHOLD;

Or we can just say, that the user attacks when the threshold is reached (makes it easier to understand if you use alternative input methods).
This commit is contained in:
Sol Huebner
2019-11-14 11:37:08 -05:00
committed by GitHub
parent 2d74fddc26
commit 42212f5a7e

View File

@@ -290,7 +290,7 @@ void loop() {
if(attacking && attackMillis+ATTACK_DURATION < mm) attacking = 0; if(attacking && attackMillis+ATTACK_DURATION < mm) attacking = 0;
// If not attacking, check if they should be // If not attacking, check if they should be
if(!attacking && joystickWobble > user_settings.attack_threshold){ if(!attacking && joystickWobble >= user_settings.attack_threshold){
attackMillis = mm; attackMillis = mm;
attacking = 1; attacking = 1;
} }