/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.4rV0bqLrTYJ/rev.2
*
* authors:
* Alexandre Murtinheira
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
void setup() {
size(300,300);
smooth(0);
background(0);
}
void keyPressed() {
if (key == 'b') {
background(0,0,255);
} else if (key == 'r'){
background(255,0,0);
}else if (key == 'g'){
background(0,255,0);
}
}
void draw() {
fill(random(0,255),random(0,255),random(0,255));
PVector mouse = new PVector(mouseX,mouseY);
PVector center = new PVector(width/2,height/2);
mouse.sub(center);
PVector right = new PVector (width/4,height/4);
mouse.sub(right);
PVector left = new PVector (width/5,height/5);
translate(width/2,height/2);
stroke(50, 0, 0);
strokeWeight(50);
point(mouse.x,mouse.y);
translate(width/4,height/4);
stroke(150, 0, 0);
point(mouse.x,mouse.y);
translate(width/5,height/5);
stroke(50, 10, 0);
point(mouse.x,mouse.y);
}