Time for action - flip through the photos

Now that we have our photos imported into Scratch, we will add a control to flip through them:

  1. From the Control palette, drag the when space key pressed block to the scripts area of the stage.
  2. Change the value from space to right arrow.
  3. When we press the right arrow key, we want to advance the slideshow to the next photo. From the Looks palette, add the next background block to the when right arrow key pressed block.
  4. Give it a try. Press the right arrow key until you've cycled through all the photos.
  5. Let's add the ability to start over. Drag another when space key pressed block into the scripts area.
  6. From the Looks palette, add the switch to background block to the when space key pressed block.
  7. Change the background name on the switch to background block to be the title screen. My title screen is wooden-house.
  8. Give it a try. Press the right arrow one or two times. Then press the Space bar to return to the title screen.
Time for action - flip through the photos

What just happened?

My dog Buddy had to have a bottle cap surgically removed from his stomach, and in exchange for his vet bill, I got to take pictures of his recovery. I like to share the photos and tell the story about how the only things visible on his X-ray were his ribs and a round bottle cap. It was like a cartoon.

When we got home, Buddy had to wear a cone around his neck to stop him from licking his incision. We made the little dog, Fritz, put the cone on, just for fun.

I can pause on each screen and reminisce for as long as I want to. When I'm ready to move on to the next photo, I press the right arrow key. The right arrow key always loads the next image, but if I want to start my story over, I press the space key.

We did not, however, build the script to view the previous image. That's because Scratch doesn't offer a previous background block. With some experimentation, we could probably come up with a way to go back through the slides, one photo at a time.

To change the order in which the photos appear, drag the photos up and down background list, which is similar to how we can arrange the costumes for a sprite.

Have a go hero

Give the photos in your slideshow a little style. Rotate one or more of the photos in your show on the stage.

Hint: Use the rotate clockwise and rotate counterclockwise tools in the Paint Editor.

Building audience participation

When it comes to controlling the action in our projects, there are multiple options. For example, the greeting card uses time and broadcast messages to direct the flow. Once the user starts the program, the user sits back and watches the animation from start to finish. It is completely automated.

It's comparable to sitting in the audience of a Broadway play. Once the curtain goes up, the actors enter the stage and the story unfolds with us as passive participants. This is a fine way to watch a play. But what if you could get out of your seat, go up to the stage, and inject yourself into the story? With Scratch, we can let the audience become active participants so that their input affects how the project plays out.

The slideshow uses keystrokes to control the action. If we want to view the next photo, we press the right arrow key. In other words, this is a completely manual approach. The slideshow doesn't advance without human interaction.

As we build our projects, we decide how much audience participation we want and we build our project that way. No wrong answer exists.

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

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