GamepadInput
This commit is contained in:
26
src/engine/input/Button.java
Normal file
26
src/engine/input/Button.java
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user