Class ArrowKeysPlayerInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.components.player.ArrowKeysPlayerInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
Keyboard input using ARROW KEYS for movement while preserving all gameplay actions
(jump, crouch, sprint, dash, inventory, mouse attack/shoot).
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
keyPressed
(int keycode) An abstract method to be implemented by subclasses for specific key down events.boolean
keyReleased
(int keycode) An abstract method to be implemented by subclasses for specific key down events.boolean
touchDown
(int screenX, int screenY, int pointer, int button) Methods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, isPauseable, keyDown, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ArrowKeysPlayerInputComponent
public ArrowKeysPlayerInputComponent()
-
-
Method Details
-
keyPressed
public boolean keyPressed(int keycode) Description copied from class:InputComponent
An abstract method to be implemented by subclasses for specific key down events. This method is called by theInputComponent.keyDown(int)
method.- Specified by:
keyPressed
in classInputComponent
- Parameters:
keycode
- The key code of the key that was pressed.- Returns:
- true if the even was handled, false otherwise
-
keyReleased
public boolean keyReleased(int keycode) Description copied from class:InputComponent
An abstract method to be implemented by subclasses for specific key down events. This method is called by theInputComponent.keyUp(int)
method.- Specified by:
keyReleased
in classInputComponent
- Parameters:
keycode
- The key code of the key that was pressed.- Returns:
- True if the even was handled, false otherwise
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) - Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classInputComponent
- See Also:
-