Time for action - joke, please

With jokes in hand, let's integrate them into our scene:

  1. Snap the joke sequence to the bottom of the set y to -116 block.
  2. Snap the point in direction -90 and glide 2 secs to x: 152 y: -47 blocks to the bottom of the joke sequence. Check your work against the following screenshot.
    Time for action - joke, please
  3. Snap the applause script to the bottom of the glide 2 secs to x: 152 y: -47 block.

    Tip

    If you need more space to work with in the scripts area, you can use the "switch to small stage" mode by clicking the small stage button located above the flag and stop sign buttons.

    Time for action - joke, please
  4. Now, let's add our drum effect to the script. We have three jokes, so we will use a broadcast and wait block to play the drum effects after each joke.
  5. After each joke, insert a broadcast and wait block. Create and select a new broadcast message for each broadcast block: play drums.
  6. Add a when I receive block to the top of the drum effects and select the play drums message.
  7. Double-click the script to watch the scene unfold.
Time for action - joke, please

What just happened?

The joke was a roaring success, and the crowd loved it. We punctuated the punchline with a drum. In order to make our scene work, we had to connect the several individual snippets of blocks we've been building for the dog scene.

The broadcast and wait block lets us synchronize the action. After each joke, we crashed the cymbals, but our script waited until the cymbals finished playing before it proceeded to the next line.

At the conclusion of the scene, our dog left to roaring applause.

Have a go hero

There's only one problem with our sprite. The dog wanders off stage after telling the joke, but its expression never changes. Give the dog a different expression, and make him lie down on his side.

See the following screenshot for a hint:

Have a go hero

Control the story

The only step left is to add some controls to the project so our users can click from one scene to the next. For navigation, we want to give users the ability to click on an item from the table of contents to play the scene. The user can then click back to the table of contents by clicking on a home link.

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

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