Class KeyboardSnakeInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.minigames.snake.controller.KeyboardSnakeInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
Input handler for the snake mini-game.
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct new snake input component with priority 5. -
Method Summary
Modifier and TypeMethodDescriptionboolean
keyDown
(int keycode) Triggers snake move events on specific keycodes.Methods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
KeyboardSnakeInputComponent
public KeyboardSnakeInputComponent()Construct new snake input component with priority 5.
-
-
Method Details
-
keyDown
public boolean keyDown(int keycode) Triggers snake move events on specific keycodes.- Specified by:
keyDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyDown
in classInputComponent
- Returns:
- whether the input was processed
- See Also:
-