Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank / CS110 Intro to Computing / 2015-Spring / Notes |
float start = 0;
void draw() {
background(128);
arc(50, 50, 80, 80, start, start + PI * 1.5);
start = start + .1;
}
int canvas_width = 500;
int canvas_height = 100;
void setup() {
size(canvas_width, canvas_height);
}
void drawButterFly(int x, int y, int w, int h) {
fill(255, 0, 128);
ellipse(x, y, w, h/2);
fill(0);
ellipse(x, y, w/4, h * 3/4);
//line(x, y, x - 10, y + 10);
//line(x, y, x + 10, y - 10);
}
void mousePressed() {
drawButterFly(mouseX, mouseY, 120, 80);
}
void draw() {
drawButterFly(canvas_width * 1/4, canvas_height / 2, 40, 80);
drawButterFly(canvas_width * 3/4, canvas_height / 2, 120, 80);
}
void mousePressed() {
stroke(random(100, 256), random(256), random(256));
}
void draw() {
line(pmouseX, pmouseY, mouseX, mouseY);
}