Time for action - enter dog

We continue to build around the broadcast message enter dog. This time we need to display the sprites:

  1. Now that we have cleared the table of contents, we need to load the dog scene. We'll bring in the background first and the dog second.
  2. With the stage selected, click on the Scripts tab.
  3. From the Control palette, add the when I receive enter dog block to the scripts area.
  4. From the Looks palette, add the switch to background block to the script and choose bedroom1.
    Time for action - enter dog
  5. Click on the dog sprite to display the scripts area for the dog.
  6. From the Control palette, drag the when I receive enter dog block to the scripts area and attach it to the top of the existing script.
  7. From the Looks palette, snap the show block in place after the when I receive enter dog block.
  8. After the scene changes, we want to delay the start of the action for a few seconds so that our users have a chance to acclimate to the switch. Snap a wait 1 secs block in place after the set y to -116 block and change the input value to 5.
    Time for action - enter dog
  9. Click on the Dog button from the table of contents and watch the dog scene load and play.

What just happened?

With one mouse click, we loaded our wise-cracking dog and learned why dogs don't use computers. We used the broadcast block to coordinate the sequence of our scene. Not only did the broadcast message enter dog hide the table of contents page, but it also loaded the dog scene.

We needed to add some timing to control the scene by delaying the start of the joke by five seconds. Without the delay, everything happened at one time: the background displayed, the dog displayed, and the joke started. It was too abrupt.

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

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