Page 59 - 2501_KVS_C-5
P. 59

6                                   SCRATCH









                Your Aim

                 6.1 Blocks using keyboard and mouse                     6.2.5  “hide variable…” block
                      6.1.1  “key… pressed?”— “Sensing” block            6.2.6  “my variable…” block
                      6.1.2  “mouse down?”— “Sensing” block         6.3 “if on edge, bounce” — “Motion” block
                      6.1.3  “when…key pressed” — “Events” block    6.4 Various Operations—
                      6.1.4   “when this sprite clicked”— “Events”       “Operators” block
                            block                                        6.4.1   Arithmetic operators— “Operators”
                 6.2 Create variables and changing their                       block
                      values— “Variables” block                          6.4.2   Relational operators
                      6.2.1  “Make a variable” button                          — “Operators” block
                      6.2.2  “set … to…” block                           6.4.3   Logical operators
                      6.2.3  “change by” block                                 — “Operators” block
                      6.2.4  “show variable…” block                      6.4.4   More operators
                                                                               — “Operators” block






                                      Aryan:  In the previous chapter, we learned how to create and destroy the
                                      clone of a sprite when required. We also learned how to move the sprite to a
                                      specific position and turn it in a particular direction. So, what are we going to
                                      learn today?

                                      Gowri: Sure dear. Today I will definitely tell you how to use the keyboard and
                                      mouse clicks in our script.




                                      Aryan:  Oh, wow! With the keyboard, we will also learn mouse clicks in our
                                      script. I am very much excited to learn it now!





                                      Gowri: Before we start, please tell me how many arrow keys are available on
                                      the keyboard.


                                      Aryan: I know this dear. There are 4 arrow keys available on the keyboard.
                                      Left arrow key (←), right arrow key (→), up arrow key (↑) and down arrow key
                                      (↓). Is it right Gowri?





                                                                                      Scratch                       57
   54   55   56   57   58   59   60   61   62   63   64