Activity : Draw Different Shapes In A Single Script
Chapter-8
Activity
Activity :Draw Different Shapes In A Single Script
In this Activity we made Individual Scripts for drawing Individual shapes. What if we could
make just one that can draw any shape?
Using operators we can! Let’s do it:
Import the Pen sprite and set the backdrop.
Then, add a repeat block and drag and drop the Sides variable block inside the space
of the repeat block. Placing the Sides variable block in the space indicates that the
repeat block will make the script inside it repeat as many times as the value of Sides.
Next, drag and drop the turn clockwise () degrees and move() steps block from
the Motion palette
Next drag and drop the change pen colour block from Pen palette.
Below is the script for making Square:
Below is the script for making Rectangle:
Below is the script for making Octagon:
Below is the script for making Circle:
Complete the script by adding a when flag clicked block.