STEP 21: Use another if to test if name is equal to "cat".

Set up the following commands to run if the hero collides with your "cat":

  • Use Sprite Gravity Off the turn off gravity for our sprite.
  • Have our sprite Go To (0, 50) and Say "I did it!"
  • Have hit_sprite Say "My hero!"

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)