User Interactivity

The instructions related to user interactivity can help your Scratch projects be more interactive, ie the person who is running it can perform actions that provoke new situations in the project. For example, I can use the keyboard or mouse to move a character, you can answer questions or playing computer webcam, among many other possibilities.

If you get 1 point...

The most basic block you can start working interactivity with the user is 'when green flag clicked'.

                    when green flag clicked
                

How this block works? When the user who wants to run your project Scratch clicks on the green flag, all blocks were placed under the block 'when green flag clicked' begin to run. You can have as many programs as you need to start with this block.

If you get 2 points...

Now that you have begun to interact with the user running your Scratch project, perhaps you can try some of the following blocks:

                     when [right arrow v] key pressed
                    move (10) steps
                    

when this sprite clicked say [Hello] for (2) secs

ask [What's your name?] and wait say (join [Hello] [answer])

if <touching [mouse-pointer v] > then say [You caught me!] end

mouse down?

go to [mouse-pointer v]

As you see, you can allow users to interact with your characters by pressing keys to move, writing answers to questions and your characters use user responses, move characters with the mouse, or perform actions when the user clicks an object.

If you get 3 points...

One of the funniest Scratch possibilities in terms of user interactivity is the possibility that the user can use your webcam or microphone to interact with characters from Scratch or sound to trigger certain actions.

                    if <(loudness) >[30]> then
                    say [There is much noise...]
                    end
                    

video [motion v] on [sprite v]

video [direction v] on [sprite v]

As you can see in the examples, we can make certain sets of blocks are executed when the ambient sound captured by the microphone is greater than a certain threshold, or when video motion occurs over an object or background. The possibilities of these blocks are very large and allows your creations Scratch are fully interactive with users.


If you get 4 points...

To achieve a score of 4 points, you need to implement advanced user interactivity using external blocks such as LEGO Mindstorms ones. Incorporate these types of blocks help us to create sophisticated interactions. For example, you could use sensors or external inputs to control your Scratch project. Here is an example:

                    if <(Distance) < (5)> then
                    say [Object very close!] for (2) secs
                    stop [all v]
                    end
                

In this example, if the sensor of Distance of the Lego Mindstorm is less than 5, the Scratch project will stop and say a message. This is a very simple example, but you can imagine how you can use this type of blocks to create sophisticated interactions.