TODO7 - Use a two sequential if statements with || to enable the 'N' and 'M' keys to move the paddle.
"public void paddleMovementCheck()"
   
  1. Find the TODO7.java starter file; this empty class also serves as a solution you can experiment and play with.
  2. Next, read all of the comments at the top of the file in the file header.
  3. Set your runner in Main.java to use TODO7.java and comment out any other setRunner calls. (see the stepwise approach for more details)
  4. Determine the single function you need to declare inside the empty class. It's described in the comments and also at the top of this webpage.
  5. Declare the function "public void paddleMovementCheck(){}" and leave it empty and rerun the game - do you notice anything different?
  6. Inside your method, you must build one if statement that asks: "if the N key is pressed, then call some method to move the paddle left."
  7. Just below that, build a second if statement that asks: "if the M key is pressed, then call some method to move the paddle right."
  8. Inside your if statements, you'll need to call one or more API functions to move paddles left and right; the API function you'll need are are described in the comments and also listed here for reference:

  9. Method Signature Description
    boolean isKeyboardButtonDown(KeysEnum targetKey) returns true if the key indicated by "targetKey" is being pressed, false otherwise
    void paddleMoveLeft(); call this function to make the paddle move left by one unit
    void paddleMoveRight(); call this function to make the paddle move right by one unit

    Type Values
    KeysEnum {LEFT, RIGHT, UP, DOWN, SPACE, ENTER, ESCAPE, SHIFT,...,L, M, N, O, P,...}