Class KeyboardMiniGameInputComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.minigames.KeyboardMiniGameInputComponent
All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener, com.badlogic.gdx.InputProcessor

public class KeyboardMiniGameInputComponent extends InputComponent
Input handler for the snake mini-game.
  • Constructor Details

    • KeyboardMiniGameInputComponent

      public KeyboardMiniGameInputComponent()
      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 interface com.badlogic.gdx.InputProcessor
      Overrides:
      keyDown in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.keyDown(int)
    • keyUp

      public boolean keyUp(int keycode)
      Specified by:
      keyUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      keyUp in class InputComponent
      See Also:
      • InputProcessor.keyUp(int)