TODO5 - Use a nested if statements to spawn a ball near the paddle by pressing the SPACE key.
"public void spawnBallCheck()"
   
  1. Find the TODO5.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 TODO5.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 spawnBallCheck(){}" and leave it empty and rerun the game - do you notice anything different?
  6. Inside your method, you must build your first if statement that asks: "if the SPACE key is pressed, then do something". That "something" will be to ask another question.

  7. Method Signature Description
    boolean isKeyboardButtonDown(KeysEnum targetKey) returns true if the key indicated by "targetKey" is being pressed, false otherwise
    boolean ballGetVisibility() returns true if the ball is visible, false otherwise
    void ballSpawnNearPaddle() call this function to make a ball visibly appear next to the paddle

    Type Values
    KeysEnum {LEFT, RIGHT, UP, DOWN, SPACE, ENTER, ESCAPE, SHIFT, ..., ONE, TWO, THREE, ..., A,B,C,...,a,b,c,...,z}