Take some time to reflect on what you have learned about creating shapes in Processing.
General Commands:
size (500, 400); // sets the width and height of the canvas
Shape Commands:
rect (X, Y, w, h);
ellipse (X, Y, w, h);
X :: (horizontal) location of the rectangle's upper left corner or ellipse center
Y :: (vertical) location of the rectangle's upper left corner or ellipse center
w :: width of the shape
h :: height of the shape
Examples:
rect (250, 200, 150, 100);
// 250,200 is the x,y coordinate
// of the top left corner of the rectangle
// 150 is the width of the rectangle
// 100 is the height of the rectangle
ellipse (250, 200, 100, 100);
// 250,200 is the x,y coordinate
// of the center of the ellipse
// 150 is the width of the ellipse
// 100 is the height of the ellipse
Comments about the program should always be included in the program. Comments are words that the compiler ignores but are useful for the programmer to remember what certain parts of code are designed to do.
To comment code, add two forward slashes // in front of the comment.
// This is a comment
You will learn more about comments in this module.