Page 77 - Digicode_AI_class_5
P. 77
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 from 10 to 100 mention and change the degrees from 15 to 90.
Step 13 In the repeat block, click and change the number of repeats from 10 to 4. Why 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 Repeat block. Change the value from 10 to 25. Click
on the Go button. Your colourful rectangle appears on the stage.
Creating Shapes in Scratch 75

