Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 38 - 2501_KVS_C-4
P. 38

    Activity 3.4

                        Take the same example of fish we studied in previous class, add a fish sprite in
                        your project with an underwater background. Create the same sprite in duplicate
                        form and float both the fishes in random positions till these fishes do not touch
                        each other. Means if these fishes touch each other then it will play sound and

                        stop floating.

                         Gowri: Before moving to the solution, one more block is to be learned now, which is given below: -

                      3.4 “TOUCHING?” BLOCK — “SENSING” BLOCK
                      All these are “Boolean” blocks.

                      3.4.1 “touching mouse-pointer?” block

                      This is known as “Boolean” block, as this has hexagonal like
                      shape. This block has a “?” question mark means it is asking
                      a question and an answer needs to be returned as true or false. And this block also

                      has drop-down menu so has three options, which are: -

                      3.4.1.1 “touching mouse-pointer?” block
                      This block is used to ask whether the sprite is touching the mouse pointer or not.

                      3.4.1.2 “touching edge?” block
                      This block is used to ask whether the sprite is touching the edge of the stage or not.

                      3.4.1.3 “touching sprite?” block

                      This block is used to ask whether the sprite is touching another sprite (name of
                      sprite appears automatically) or not.

                      3.4.2 “touching color?” block

                      This is also a “Boolean” block, and asks whether the sprite is touching a color or not.
                      You can choose a color of your own choice which you want to compare.

                      3.4.3 “color is touching?” block

                      This is also a Boolean block, and ask whether the color specified on the left side in
                      stage is touching the color given on the right side or not. You can choose a color of

                      your own choice which you want to compare.

                         Aryan: Ok! Thanks, dear, for telling this, I get it, we will use these blocks to check whether fish
                         is touching another fish or not.

                    36                         KVS DELHI REGION 2025

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