/* Base code to draw a grid for use in PCS 6th grade - Z. Wood*/ boolean drawG; void setup() { //set the screen size, variables renamed in different Processing versions //size(screen.width, screen.height); size(800, 800); drawG = true; /* change DrawG to false to turn off the grid */ //drawG = false; } /*Method to draw a grid every 50th pixel */ void drawGrid() { //the horizontal lines - every 50th pixel draw a line stroke(0, 0, 128); for (int i=0; i < height/50; i++) { line(0, (i+1)*50, width, (i+1)*50); } //the vertical lines - every 50th pixel draw a line stroke(128, 0, 128); for (int i=0; i < width/50; i++) { line((i+1)*50, 0, (i+1)*50, height); } } void draw() { background(255); if (drawG == true) { drawGrid(); } stroke(0); strokeWeight(3); //ears fill(128); triangle(150, 300, 100, 50, 300, 150); triangle(500, 150, 700, 50, 650, 250); //head fill(255); ellipse(400, 400, 600, 600); //eyes fill(128); ellipse(300, 400, 100, 80); ellipse(500, 400, 100, 80); //FILL in the pupils //mouth line(400, 450, 400, 550); line(400, 550, 300, 600); //FILL in the side of the mouth //Fill in the nose saveFrame("part_cat.jpg"); }