Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this add-on, you will let the user adjust the size of the pen.
The users drawing in your program might want a smaller pen to do more detailed work, or
a bigger pen to color in large areas.
To change the pen size, select the pencil sprite, and drag out a "change pen size" block.
Test it out.
Click the block, then draw a line with the pen.
Change the value in the block to 5.
Click the block again, then draw a line.
Notice how the line gets thicker.
To let the user change the pen size without having to click this block, add a "when key
From the dropdown menu, select the up arrow key.
Now the user can make the pen bigger by pressing the up arrow key.
To make the pen smaller, add another "change pen size by" block.
Change the value to negative 5 to decrease the size of the pen.
Add a "when key pressed" event, and select "down arrow."
Now the user can adjust the size of the pen using the up and down arrow keys.
Now it's your turn: Program the up and down arrow keys to make
the pen bigger and smaller.