Class TouchPlayerInputComponent

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

public class TouchPlayerInputComponent extends InputComponent
Input handler for the player for keyboard and touch (mouse) input. This input handler uses keyboard and touch input.
  • Constructor Details

    • TouchPlayerInputComponent

      public TouchPlayerInputComponent()
  • Method Details

    • keyDown

      public boolean keyDown(int keycode)
      Triggers player 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)
      Triggers player events on specific keycodes.
      Specified by:
      keyUp in interface com.badlogic.gdx.InputProcessor
      Overrides:
      keyUp in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.keyUp(int)
    • touchDown

      public boolean touchDown(int screenX, int screenY, int pointer, int button)
      Triggers the player attack.
      Specified by:
      touchDown in interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class InputComponent
      Returns:
      whether the input was processed
      See Also:
      • InputProcessor.touchDown(int, int, int, int)