Time for action - turn to the left

Using the Motion palette, turn the dog around:

  1. Add the point in direction 90 block to the top of the glide block.
  2. Change 90 to -90.
  3. Add the point in direction 90 block to the top of the set x to -56 block.
  4. Double-click each script to run the blocks of code. The dog now faces in the correct direction, but it rotates upside down.
  5. Remember in Chapter 3 when we discovered the flip rotation button? Use the rotation buttons so that the dog only faces left-right.
Time for action - turn to the left

What just happened?

If you thought about the blocks of code we just added, you might be wondering why we set the direction to -90 to make our sprite face right and glide away from the microphone.

Remember, we altered the dog's costume when we added it. The dog's face pointed to the right by default, but we flipped it horizontally. Now, the dog's tail points to the right. Scratch didn't identify the sprite in terms of the dog's face and the dog's tail. Instead, it saw the left side of the sprite and the right side of the sprite.

When we returned the dog to the front of the microphone, we pointed the sprite's direction to 90 to make the dog face the microphone.

Degrees of direction

Scratch enables us to point a sprite in one of the four major directions by default: 90 (right), -90 (left), 180 (down), and 0 (up).

To enter a non-default direction, click in the input box of the point in direction block, and type the new value. The following help window from Scratch illustrates how to use the point in direction block:

Degrees of direction

Note

You can view the help topic for any block by right-clicking on the block and selecting Help.

Sound effects

Importing sounds into our project makes adding sound effects easy, but the musically inclined among us will appreciate the ability to build custom sound effects. Let's try our hand at creating a drum effect that plays on the punchline of the dog's joke.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset