Class KeyboardShipInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.components.ships.KeyboardShipInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener,com.badlogic.gdx.InputProcessor
Input handler for the ship for keyboard.
This input handler only uses keyboard input.
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDown, touchDragged, touchUp, zoomMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
KeyboardShipInputComponent
public KeyboardShipInputComponent()
-
-
Method Details
-
keyDown
public boolean keyDown(int keycode) Triggers ship events on specific keycodes.- Specified by:
keyDownin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyDownin 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:
keyUpin interfacecom.badlogic.gdx.InputProcessor- Overrides:
keyUpin classInputComponent- Returns:
- whether the input was processed
- See Also:
-
InputProcessor.keyUp(int)
-