Page 87 - 2403_Trackpad_V5.1_C6_Fb
P. 87

Blocks                                           Functions




                                                Checks  whether the  sprite  is  touching  the  mouse  pointer,  the
                    touching mouse-pointer  ?   edge, or another sprite. If yes, the block returns true; if it is not, it
                                                returns false. It is used with an if-then block.

                                                Checks whether the sprite is touching a specified colour. If it is, the
                       touching color   ?
                                                block returns true. It is used with an if-then block.


                                                Makes an input box (with the specified text above it) and displays
                  ask  What’s your name?  and wait  it at the bottom of the screen. The user can then enter text into it
                                                and submit it. The input is stored in an Answer block after that.



                               answer           Holds the most recent text entered with the Ask () and Wait block.


                                                Checks if the specified key is pressed. If the key is being pressed,
                     key  space   pressed?
                                                the block returns true; if it is not, it returns false.






                                Role of Video Sensing extension in Scratch




                 Using the Sensing Menu                                            when       clicked
                 Now use the Sensing menu for Ask the user for age, User
                 types in age, Display the stored answer.                          set  age    to 0
                                                                                   ask   What’s your age?  and wait
                 Now, create a variable named age.
                                                                                      set  age    to answer
                 After creating the variable age, let us create the following
                 block stack for the sprite: Now, click on the green flag.        say  Join  I Know your age is  answer


                                 Cat displays the message “What’s your age?”











                                                                               We can enter our age here
                                                                               (Here, we have entered the
                                                                                age 12) and click on the
                                                                                      Tick button.




                                                                                                 Blocks in Scratch  85
   82   83   84   85   86   87   88   89   90   91   92