Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 39 - 2501_KVS_C-4
P. 39

    Gowri: Yes, dear, we will use this block for checking, whether both sprites are touching each
                        other or not, in the next steps, given below:

                     Ans
                     Step 1:  Add a sprite fish (from “animals” tab) in Scratch named as

                                “Fish” and remove the already added sprite “cat” from the
                                “delete” icon.

                     Step 2:  Choose a background by “choosing a backdrop” icon from an
                                “underwater” tab (e.g. under water-2).
                     Step 3:  Click on “Events” block, and drag “when flag clicked” block in

                                the script area.

                     Step 4:  From  “Looks”  block,  choose  “switch
                                costume to…” block in the script area.
                                And  choose  value  to  fish-c.  (You  can
                                choose any other fish).

                     Step 5:  Right  click  on the  sprite,  choose  the
                                “duplicate” option from the pull-down
                                menu. Both the  sprite and script are

                                duplicated  and new sprite created
                                named as Fish2. (Shown in Fig. 3.6)
                                                                                   Fig. 3.6: One glimpse of both fishes
                     Step 6:  Select the first sprite “Fish” and drag                       floating in water
                                block choose “repeat until…” block in the script area from the “Control” block,
                                to repeat the steps of floating of the fish until it touches the second fish.

                     Step 7:  Drag “touching mouse-pointer?”  block  from the  “Sensing” block  inside
                                “repeat”  block  after  “until”  for  checking  whether  the  sprite  “fish1”  is
                                touching the sprite “fish2” or not. Then choose “Fish2” from the dropdown
                                of mouse-pointer.

                     Step 8:  From “Motion” block choose “glide... secs to random position” block in the

                                script area. And change the value 1 to any other number (say 10) to float
                                the fish very much slowly and naturally in water to a random position.
                     Step 9:  Drag “play sound… until done” block from “Sound” block and drop it after

                                “repeat”  block  means  playing  the  sound  after  touching  this  first  sprite
                                with second sprite (Fish2). Then drag “stop all” block from “Control” block
                                to stop every code running either on both the sprites.

                     Step 10:  Select the sprite “Fish2” now and then drag and drop “forever” block from
                                “Control” block and then drag “glide... secs to random position” block of
                                “Motion” block in the script area. Then change the value 1 to any other

                                                                                          Scratch                       37

| 34 35 36 37 38 39 40 41 42 43 44 |