Page 61 - 2501_KVS_C-5
P. 61

Let’s learn it with the help of activities. (See activity 6.1 and 6.2)




                               Activity 6.1

                   Add  a  sprite  (any  bird)  in  your  project  and  fly  it  with  spreading  its  wings

                   continuously until space key is pressed. Means when space key is pressed then
                   the sprite stops flying.



                 Answers


                 Step 1:   Add  a  sprite “bat”  (from “animals”  tab) in
                             scratch.
                 Step 2:   Choose the sprite “bat” and drag the “when flag

                             clicked” block from the “Events” blocks in the
                             script area. Now, do the coding in the “forever”
                             block for flying as well as changing its costume
                             (for spreading the wings) continuously (shown
                             in Fig. 6.1).

                 Step 3:   Now, drag “When space key is pressed” block
                             in script area and then drag “stop all” block
                             inside it. (shown in Fig.  6.1).

                                                                                                   Fig. 6.1



                              Activity 6.2

                   Add a sprite to your project. When the “right” arrow key
                   is pressed, move the sprite 10 steps forward. When the

                   “left” arrow key is pressed, move it 10 steps backward.
                   Pressing  the  “down”  arrow key  will turn  the  sprite 30
                   degrees to the right, while pressing the “up” arrow key will
                   turn it 30 degrees to the left. Finally, pressing the “space”
                   key will move the sprite 20 steps forward.












                                                                                                     Fig. 6.2



                                                                                      Scratch                       59
   56   57   58   59   60   61   62   63   64   65   66