Page 72 - Learn To Program With Scratch
P. 72

n o t e    You can use the switch backdrop to command to change scenes in a story, switch
                         levels in a game, and so on. Any sprite in your project can use the when backdrop
                         switches to block to detect when the Stage has switched to a certain costume and act
                         accordingly. See the Tips window in the Scratch interface for more details.


                         Sprites That Speak and Think
                         You can use the say and think commands to make your sprite speak or
                         think like a character in a comic strip, as illustrated in Figure 3-3 (left).



                                                        2 seconds later





                         Figure 3-3: Use the say or think commands to show a message
                         in a speech or a thought bubble .

                             Any phrase you type into these commands will appear above the sprite,
                         and the message is displayed permanently. If you want to clear the message,
                         use a say or think block with no text. You could also display a message for a
                         fixed time instead with the say for secs (or the think for secs) command,
                         as illustrated in Figure 3-3 (right).



                                                   try it out 3-2
               Argue .sb2   To see the Say and Think commands in action, open the file Argue.sb2 and run
                            it . This application simulates an endless argument between two characters, as
                            illustrated below . Study the scripts to understand how they use accurate timing to
                            synchronize the actions of the two characters .

                                                             No, I am the      No, I am the
                                 I am the cute                cute one.         cute one.
                                    one.





                                                      2 seconds later        2 seconds later




                         Image Effects
            GraphicEffects   The set effect to command allows you to apply different graphic effects
                     .sb2  to costumes and backdrops. Scratch gives these effects names like fisheye,
                         whirl, mosaic, and so on. Figure 3-4 shows exactly what they do.



           50   Chapter 3
                                           www.it-ebooks.info
   67   68   69   70   71   72   73   74   75   76   77