Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 110 - KEC_2615
P. 110

    Some of the sensing blocks and their functions are given below:

                                    Blocks                                           Function

                                                           This block checks if the Sprite touches the mouse-

                                                           pointer, another Sprite or the edge. If the answer is
                                                           true, then it executes the blocks given after it in the
                                                           condition. If false, then it executes other blocks as

                                                           per the given condition.
                                                           This block checks if the Sprite is touching the colour

                                                           chosen in the block. If true, then it executes a set of
                                                           blocks, else executes another set of blocks.

                                                           This block checks if the first chosen colour is touching
                                                           the second chosen colour. If true, then it executes a

                                                           set of blocks, else executes another set of blocks.
                                                           This block returns True if any of the mouse buttons

                                                           are being pressed while the cursor is over the stage.

                                                           This block  checks  if the  chosen  key  is  pressed  by
                                                           the user. If true, then it executes a set of blocks, else
                                                           executes another set of blocks.

                      Let us make a small script.

                      Change  the  Sprite  to  fish  and  change  the
                      backdrop to Underwater 2.

                      Drag the Events block, when green flag clicked
                      to the script area. Drag the control block, forever
                      to the script area and put it to the green flag

                      block. Drag the move block and put it inside the
                      forever block. Now, drag the if on edge, bounce
                      block and put it inside the forever block.

                      Now, put the control block if,then inside the forever block and snap the sensing
                      block, touching color  in the hexagon of the if loop.

                      108   Premium Edition-III

| 105 106 107 108 109 110 111 112 113 114 115 |