Page 44 - ModularV1.1 _c5_flipbook
P. 44

This block helps to bring the sprite to the desired location.




















                      CREATING A SCRIPT

                  A script is another name for a program. Let’s create some scripts.
                  Sprite Playing with a Ball


                  Arrange the blocks to create the following scripts for the cat and ball Sprite and
                  then run the script. Let’s program our sprites with some codes:

                  Step 1  Change the backdrop to ‘Bench with View’.

                  Step 2  Add a Sprite ‘Beachball’.
                  Step 3  Drag the blocks as shown for both sprites.

                  Step 4  Click on the Green flag to run the script.


















                     For Beachball Sprite         For Cat Sprite                          Output
                  Talking and Jumping Sprite


                  So far you have learnt how to create a script and make them move. In this topic,
                  you will learn how to make the sprite talk.

                  Step 1  Drag the  when          clicked  block from Events block menu. This block will

                           activate once the green flag is clicked.

                  Step 2  Drag  the  go  to  x: 0  y: 0  block from the Motion blocks menu to set the

                           initial position of the Sprite.


                  42      Modular (Ver. 1.1)-V
   39   40   41   42   43   44   45   46   47   48   49