Page 74 - Computer Genius Class 05
P. 74

Step 7   Click on the               block and drag it to the script area. Snap it to the script.

                           Click on the colour dot and choose a colour of your choice.

                   Step 8   Click on         block and drag it to the script area and snap it to the script.

                   Step 9   Next, click on Control blocks category        .


                   Step 10  Click and drag the             C block to the script area. Snap it to the script.


                   Step 11   Now, on the Motion blocks category        .


                   Step 12  Next, drag the             and                blocks and snap them inside the C block.
                           When you position any block inside the C block, it expands to fit the blocks. Change
                           the steps  rom 1  to 1   mention and change the degrees  rom 1  to   .


                   Step 13   n the repeat  loc   clic  and change the num er o  repeats  rom 1  to  .  hy are
                           we doing this? We know that a square has 4 sides.

                   Step 14  If you do not want the sprite to appear over the figure, you can end the code here.

                           But if you want to see both the shape and the sprite, snap the            block at the end
                           of the code.































                  Drawing a Rectangle in Scratch

                  To draw a rectangle in Scratch, follow the same code you used to draw a square. In the repeat
                  block, change the values of the Repeat and Motion blocks as shown in the given code.
                  You can also draw a multi-colored rectangle. To do so, remove the                         block and

                  place the block                      in the  epeat  loc .  hange the  alue  rom 1  to 2 .  lic
                  on the Go button. Your colourful rectangle appears on the stage.


                       72    Computer Genius-V
   69   70   71   72   73   74   75   76   77   78   79