Page 110 - CodePilot V5.0 C4
P. 110

Block                                           Function

                                               These blocks have a notch at the top and flat bottom. They
                                               end a script. Nothing can go under them. For example: the
                         Cap Block             stop all block.





                          EVENTS BLOCKS



                  Events blocks  start  scripts  when something
                  happens.  They make  the  project  interactive  by

                  reacting to actions. Some of the commonly used                  There are 7 Hat and 2 Stack blocks
                  event blocks with their descriptions are as follows:            in the Events Block category.


                                                      This block starts  the script  when  the green flag  is
                                   when     clicked
                                                      clicked. It is often used to begin a project.

                                                      This block  starts  the  script  when the  backdrop
                 when backdrop switches to  backdrop1
                                                      changes to a specified one.




                          MOTION BLOCKS


                  Motion blocks let you control your sprite’s movement. You can use them to make

                  your sprite move, rotate or glide in any direction you choose. Some Motion blocks
                  need values for coordinates and directions. Some of the commonly used Motion
                  blocks and their descriptions are as follows:


                                                      This block instantly moves the sprite to a specified
                             go to  random position   location,  which can be  that  of another  sprite,  the
                                                      mouse pointer or a random location.


                                                      This block  instantly  moves  the  sprite  to  a  specific
                                go to x:  0  y:  0
                                                      location (x, y) on the screen.


                                                      This block  makes  the  sprite  move  smoothly  to  a
                    glide  1  secs to x:  0  y:  0
                                                      specified location (x, y) over a set number of seconds.


                                                      This block changes the sprite’s position horizontally,
                                   change x by  10    moving  it  to  the right (positive  number) or left

                                                      (negative number).


                 108      CodePilot (V5.0)-IV
   105   106   107   108   109   110   111   112   113   114   115