STEP 10: Let's have our sprite do something no matter what the user answers! Use the LOGIC tab in the toolkit.

The else block will run whenever the if-block does NOT run.

  • Click on . Drag out Else. Drop it at the bottom of your program OUTSIDE the if-block.
  • In the GRAPHICS tab, click on . Drop Moon indented INSIDE the else-block.
  • Click Run and give an answer other than “yes”. This will cause the else-block to run!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)