Draw a Figure

Creating the Look

Previously, you coded and modified an image of a happy face. Now, you will combine shapes in order to create a more complex original figure of your choosing (e.g., the robots to the right). Unlike your picture from Writing Code, this figure will not focus only upon a static outcome (i.e., what it looks like), but instead includes other considerations, such as how the figure will behave or how we might interact with it. What is the distinction? In terms of Scratch, the distinction between a background image and a sprite would be similar: there is much more associated with a sprite than simply its static appearance.

For this assignment, however, we will focus solely on the appearance of your original figure. While designing the figure, though, think about possible future behaviors as well.


Using vector shape-drawing commands in Processing, code a sketchbook that draws a figure. Examples of good figures might include a robot, person, cat, kangaroo, automobile, etc.


You must submit the .pde of the Processing sketchbook that draws your original figure.


  • Read an example piece of code containing a drawing. Outline the steps in the example. Think about how can you apply these skills to your own drawing.
  • As always, examine the Processing Reference Page. Focus on 2D Shapes, particularly the ellipse(), line(), point(), rect(), and triangle() functions to create a figure.
  • Remember that the window size is stored in width and height variables. If you’d like to reference the exact center of the window, use something akin to point(width/2, height/2).
  • The println() function can be a lifesaver when troubleshooting your code. Use it to output diagnostic messages as needed. Reference the Debugging with println() Guide.

Reference Starting Points

Functions Variables
ellipse() width
line() height