TODO0 - Use a single if statement to determine if the game has been won.
"public void wonGameCheck()"
   
  1. Use the links to the left under "Setup" and follow the instructions to set up SpaceSmasher.
  2. Read the section at the bottom of this webpage for a stepwise approach on how to run experiments in SpaceSmasher.
  3. Find the TODO0.java starter file; this empty class also serves as a solution you can experiment and play with.
  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 wonGameCheck(){}" and leave it empty and rerun the game - do you notice anything different?
  7. Inside your method, you must build one if statement that asks: "if all the blocks are removed, then call the gameWin() function."
  8. Inside your if statement, you'll need to call one or more API functions to determine if the blocks have been removed, which are described in the comments and also listed here for reference:

  9. Method Signature Description
    boolean areAllBlocksRemoved() returns true if no more blocks are onscreen
    void gameWin() call this function to move to the "won the game" screen if the game has been won
    void gameLost() call this function to move to the "game over" screen if the game has been lost