Class KeyboardPlayerInputComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.input.InputComponent
com.deco2800.game.components.player.KeyboardPlayerInputComponent
- All Implemented Interfaces:
GestureDetector.GestureListener
,InputProcessor
public class KeyboardPlayerInputComponent extends InputComponent
Input handler for the player for keyboard and touch (mouse) input.
This input handler only uses keyboard input.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description KeyboardPlayerInputComponent()
-
Method Summary
Modifier and Type Method Description Vector2
getWalkDirection()
boolean
keyDown(int keycode)
Triggers player events on specific keycodes.boolean
keyUp(int keycode)
Triggers player events on specific keycodes.void
removeBuff_Debuff()
Methods inherited from class com.deco2800.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.deco2800.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
KeyboardPlayerInputComponent
public KeyboardPlayerInputComponent()
-
-
Method Details
-
keyDown
public boolean keyDown(int keycode)Triggers player events on specific keycodes.- Specified by:
keyDown
in interfaceInputProcessor
- Overrides:
keyDown
in classInputComponent
- Returns:
- whether the input was processed
- See Also:
InputProcessor.keyDown(int)
-
keyUp
public boolean keyUp(int keycode)Triggers player events on specific keycodes.- Specified by:
keyUp
in interfaceInputProcessor
- Overrides:
keyUp
in classInputComponent
- Returns:
- whether the input was processed
- See Also:
InputProcessor.keyUp(int)
-
getWalkDirection
-
removeBuff_Debuff
public void removeBuff_Debuff()
-