Page 67 - Touchcode_C4_Flipbook
P. 67

adds a  thought  bubble to the Sprite with  the   Events Block
 given text, for the given time in seconds.  An event is a happening which occurs due to some other things


  shows a thought bubble with the given text. The bubble   that happened before it. So, Events block actually control how
 will continue to appear until another speech or thought block is   the blocks in a script, will start to run, if a particular action is
 activated, or the stop button is pressed.  done. Events blocks control events and the starting of scripts.
                 They are yellow in color.
     and    shows and hides the Sprite on the stage.
                                block activates the script when the green flag or
  changes the Sprite according to the selected effect. The seven

 effects are: color, fisheye, whirl, pixelate, mosaic, brightness and ghost.   Go button is clicked.
                                    block activates the script when the chosen key is pressed. You can
                      choose from the given keys or you can choose the option any.

                                 block activates the script when you click the sprite.


                 Control Block

                 They have looping blocks which are used when the same blocks have to be repeated

                 for a number of times. The most commonly used control blocks are:

                                   block pauses the running of the script for the number of seconds given
  block will reset any graphical effects on the sprite. They will be reset
 to their default value zero.  in the block. You can use this block when two move or speak blocks are coming
                      one after the other.

 Sound Block            The repeat block repeats a set of blocks for a given number of

 Sound blocks are in pink color. They control sound functions. We can add music to   times. This block is also used to draw shapes where we have to
 our Scratch project by using Sound blocks. You can even record your voice and save   give the same blocks again and again for a number of times.

 it. You can play it with a sprite.        The forever block keeps on repeating a set of blocks till the stop

  block plays a sound without pausing the   button is clicked. This block is similar to repeat block and expands
 script. The sound  options  are “Meow” or recorded   automatically to accommodate the blocks you snap inside it.
 sound.
                 SETTING THE SPRITE POSITION
  block plays the sound by pausing the

 script until the sound has finished playing. The sound options are “Meow” or   The stage is divided into different values of x and y. Each dot on the stage is made
 any recorded sounds.  up of both x and y values. The value of x gives the horizontal (left to right) location
                 of the Sprite. The value of y gives the vertical (top to bottom) location of the Sprite.
    To stop all sounds being played on all Sprites, use    block.
                 The centre of the stage has x and y values as 0.
     block clears all existing sound effects.







                                                                                            Coding Corner        65
   62   63   64   65   66   67   68   69   70   71   72