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

public class ArrowKeysPlayerInputComponent extends InputComponent
Keyboard input using ARROW KEYS for movement while preserving all gameplay actions (jump, crouch, sprint, dash, inventory, mouse attack/shoot).
  • 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 the InputComponent.keyDown(int) method.
      Specified by:
      keyPressed in class InputComponent
      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 the InputComponent.keyUp(int) method.
      Specified by:
      keyReleased in class InputComponent
      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 interface com.badlogic.gdx.InputProcessor
      Overrides:
      touchDown in class InputComponent
      See Also:
      • InputProcessor.touchDown(int, int, int, int)