O'Reilly logo

Scratch 1.4 by Michael Badger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - draw a graph

We want to graph each day and newAmount pair in our calculation. To help accomplish this task, we'll add a broadcast block to the end of the forever if block.

  1. With the double sprite selected, add a broadcast block as the last block in the forever if block. Add a second broadcast block before the forever if block starts so that we make sure we graph day 1.
  2. Create a new broadcast message named graph, and select it in both broadcast blocks.
  3. For every broadcast we send, we need to program something to receive it. From the Control palette, add a when I receive block to the double sprite. Make sure graph is set in the drop-down menu.
  4. In our graph, days will be represented by an x value and the newAmount will be represented ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required