Drawing with the PenDrawing with the PenBarb EricsonBarb EricsonGeorgia TechGeorgia Tech
June 2011June 2011
Project Description• We will create a
spider sprite and have it draw with the Pen blocks– We will teach it to draw a
square– And make a flower out of
many squares
Big Picture• Delete the cat
sprite• Paint the sprite
that you will draw with– A spider
• Program the sprite– To draw a
square when it receives a square message
– And a flower out of many squares
Delete cat sprite• To delete the cat
– Click the scissors– Click the cat
• Or right click on the cat and select delete
Draw the sprite• Click on the
star with a paintbrush– Under the
stage view
Using the paint program
• Click on the ellipse tool– Click the filled
circle– Pick the color– Click and drag
to draw a circle
Draw legs for the spider
• Use the line tool to draw legs– Click on the line
tool icon– Pick the color for
the legs– Click and drag to
draw
Draw a head and eyes• Use the ellipse
tool to draw a head and eyes– Click "undo" if
you make a mistake
– Click "OK" when done
Grow or shrink sprite• You can change the
size of the sprite– Click on the arrows
pointing out icon to grow it and arrows pointing in to shrink
– Then click on sprite
Programming Steps• When the
green flag is clicked do all set-up– Clear the
drawing area– Draw a square
• How do you draw a square?– Repeat 4 times
• Move 50 steps• Turn 90
degrees
Set-up• When the green
flag is clicked - Control– Clear the drawing
area – in Pen– Put the pen down
– also in Pen
Draw a Square• Repeat 4 times
– Control– Move 10 steps
– Motion• Change to 50
– Turn – Motion• Change to 90
Drawing many squares• We can draw a
flower by drawing many squares– And turning
between them
Breaking this into pieces
• Use broadcast and receive to make reusable parts– drawSquare– drawSquareFlow
er
Challenge• Add other shapes
– Triangle• Add a way to clear the drawing
– When you press a key• Add a variable to control the width of
the square– You can even make this a slider
Connection to Art• Piet Mondrian made
modern art with just black lines and solid colors– Can you do something
like this?– Try setting the pen
width and color
Top Related