Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 87 - 2607_Trackpad_Pro_5.1_flipbook_C6
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
                                                                                       set  age   to  0
                     types in age, Display the stored answer.
                     Now, create a variable named age.                                 ask   What's your age?  and wait
                     After creating the variable age, let us create the following      set  age   to  answer
                     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.

                                              1. Which block is used to ask questions in Scratch?
                                              ______________________________________________________
                             uiz   Bee        2. Write the Repeat command to draw a pentagon in Scratch.

                                              ______________________________________________________

                                                                                                     Blocks in Scratch  85

| 82 83 84 85 86 87 88 89 90 91 92 |