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 - force a positive fortune

Before we begin this exercise, re-order your answers list so that all the positive responses are at the end. Edit the list items in your text editor and then re-import the list. Make a note of where the first positive response begins:

  1. Our first task is to set up a variable to count how many questions the seeker asks so that we can calculate whether or not it's time to answer positively. Select the stage from the sprites list and create a new variable named question_number.

    Note

    We add the variable to stage because both sprites will use the variable, and when we create a variable on the stage it's always a global variable.

  2. Add the when flag clicked block to the scripts area.
  3. From the Variables palette, ...

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