GamepadInput

This commit is contained in:
Antoine
2021-06-01 17:59:04 +02:00
parent b276f1eca4
commit 6dcd7feda5
3 changed files with 33 additions and 9 deletions

View File

@@ -0,0 +1,26 @@
package engine.input;
import java.util.List;
public class Button {
public String name;
private final List<Integer> buttons;
public Button(String name, List<Integer> buttons, GamepadInput controller){
this.name = name;
this.buttons = buttons;
}
public void addButton(int key){
this.buttons.add(key);
}
public boolean isButtonPressed(){
for (int i : buttons){
GamepadInput.checkPressed(i);
}
}
}