/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.P1FjMdtfqbH/rev.3
*
* authors:
* kara schultz
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/*Kara Schultz
09/23/12
[email protected]
Self-portrait deux
My designblocks self-portrait simply ran continuously, without variables. This second "portrait" only
runs with the aid of user interaction (i.e. nothing happens without a key or mouse press). In other
words, my designblocks portrait was static, and my self-portrait number 2 is a dynamic program. When any
key is pressed, a rectangle will appear. Similarly, when the mouse is pressed, a triangle will appear.
*/
void setup() {
size(400, 400);
background(118, 22, 103);
noStroke();
smooth();
frameRate(60);
textSize(32);
}
void draw() {
}
void mousePressed() {
strokeWeight(6);
stroke(random(0, 255), random(0, 255), random(0, 255), random(0, 255));
line(pmouseX, pmouseY, width/2, height/2);
fill(random(0, 255), random(0, 255), random(0, 255), random(0, 255));
triangle(width/2, height/2, 240, 240, mouseX, mouseY);
}
void keyPressed() {
rect(random(0, 300), random(0, 300), random(0, 300),random(0,300));
fill(random(0, 255), random(0, 255), random(0, 255), random(0, 255));
}