TODO0 - Use a single if statement to change the paddle image if the user presses "P".
"public void changePaddleImageCheck()"
   
  1. Complete the lab section first for practice with Space Smasher before moving on to the assignment.
  2. Remember to experiment with your game by enabling and disabling the solution to observe the desired behaviour (see the Stepwise Approach below).
  3. Find the TODO0.java starter file; run the empty solution file and explore the behaviour that you will replicate with your code.
  4. Next, read all of the comments at the top of the file in the file header.
  5. 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.
  6. Declare the function "public void changePaddleImageCheck(){}" and leave it empty and rerun the game - do you notice any missing behaviour?
  7. Inside your method, you must build one if statement that asks: "if the "P" key is being pressed, then call the paddleSetImage() function."
  8. Inside your if statement, you'll need to call one or more API functions to set the paddle image, which are described in the comments and also listed here for reference:
  9. If you are getting an "image not found" error , be sure you've put the image in the "SpaceSmasher/resources/paddles" directory and are passing paddleSetImage a string prefixed with "paddles/", as in: "paddles/P2.png"

    Method Signature Description
    boolean isKeyboardButtonDown(KeysEnum targetKey) returns true if the key indicated by "targetKey" is being pressed, false otherwise
    void paddleSetImage(String fileName)         call this function to set the paddle image to the file specified in "fileName", which needs to include the path:"paddles/", so for example: "paddles/P2.png"

    Type Values
    KeysEnum {LEFT, RIGHT, UP, DOWN, SPACE, ENTER, ESCAPE, SHIFT, ..., ONE, TWO, THREE, ..., A,B,C,...,P,Q,R,...,Z}

  10. Once you've experimented with the methods above, consider playing with the extended set of methods below for even more complex and fun game behaviors

  11. Extended Method Signature Description
    void paddleSetImage(String fileName, int whichPaddle) call this to set the paddle image specified by "fileName" for the paddle indicated by the integer index "whichPaddle" (for games with more than 2 paddles like a powerup or for multi-player)