Step 5 – Programming Thor

Goal:


Let’s move on to programming Thor. Don’t forget switch sprites by selecting Thor on the right side of your screen.

The code will once again be nearly identical!

Steps:

  1. Click on the Thor sprite.
  2. Click on Control.
  3. Drag when backdrop switches to to an empty space.
  4. Make sure to switch the event to Find Thor.
  5. Click on Motion.
  6. Drag set x to and set y to underneath When Backdrop switches to.
  7. Click on Operators.
  8. Drag pick random into both both motion blocks.
  9. Set x from -240 to 240 and y from -130 to 180.
  10. Lastly, drag show from the looks tab as the last block.

Scratch:




Now let’s make Hawkeye speak and transition to the next backdrop when clicked.

Steps:

  1. Click on Events.
  2. Drag  When this sprite clicked to an empty space.
  3. Click on Looks.
  4. Drag two  Say for 1 seconds blocks underneath the event block.
  5. Type You Found Me! and Next level!
  6. Click on Events.
  7. Drag  Broadcast under the Say blocks and select m2.
  8. Drag a  Hide block over from the Looks tab.
  9. Click on Events.
  10. Drag When green flag clicked to an empty space.
  11. Click on Looks.
  12. Drag hide underneath when green flag is clicked.